<commit_before><?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Schema;

class AlterLtUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table(config('user.table'), function (Blueprint $table) {
            if (!Schema::hasColumn('name')) {
                $table->string('name')->default('name');
            }
            if (!Schema::hasColumn('firstname')) {
                $table->string('firstname')->default('firstname');
            }
            if (!Schema::hasColumn('lastname')) {
                $table->string('lastname')->default('lastname');
            }
            if (!Schema::hasColumn('email')) {
                $table->string('email')->unique();
            }

            if (!Schema::hasColumn('password')) {
                $table->string('password', 60);
            }
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
<commit_msg>fix - add second field to hasColumn<commit_after><?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Schema;

class AlterLtUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable(config('laravel-tournaments.user_table'))) {
            Schema::create('users', function (Blueprint $table) {
                $table->increments('id');
                $table->string('name');
                $table->string('firstname')->default('firstname');
                $table->string('lastname')->default('lastname');
                $table->string('email')->unique();
                $table->string('password', 60);
                $table->timestamps();
            });
        } else {
            Schema::table(config('laravel-tournaments.user.table'), function (Blueprint $table) {
                if (!Schema::hasColumn(config('laravel-tournaments.user.table'), 'name')) {
                    $table->string('name')->default('name');
                }
                if (!Schema::hasColumn(config('laravel-tournaments.user.table'), 'firstname')) {
                    $table->string('firstname')->default('firstname');
                }
                if (!Schema::hasColumn(config('laravel-tournaments.user.table'), 'lastname')) {
                    $table->string('lastname')->default('lastname');
                }
                if (!Schema::hasColumn(config('laravel-tournaments.user.table'), 'email')) {
                    $table->string('email')->unique();
                }

                if (!Schema::hasColumn(config('laravel-tournaments.user.table'), 'password')) {
                    $table->string('password', 60);
                }
            });
        }


    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}

{'fraction_non_alphanumeric': 0.16246153846153846, 'fraction_numerical': 0.0018461538461538461, 'mean_word_length': 1.9394213381555154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7058367', 'n_tokens_mistral': 889, 'n_tokens_neox': 860, 'n_words': 125}