<commit_before><?php

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

/** @noinspection AutoloadingIssuesInspection */
class AddProjectFieldsToBatchTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('reg_batch', function (Blueprint $table) {
            $table->timestamps();
            $table->unsignedInteger('project_id')->nullable()->index();
            $table->foreign('project_id')->references('id')->on('reg_agent')->onUpdate('NO ACTION')->onDelete('CASCADE');
            $table->unsignedInteger('user_id')->nullable()->index();
            $table->foreign('user_id' )->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('CASCADE');
            $table->string('next_step')->nullable();
            $table->mediumText('step_data')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('reg_batch', function (Blueprint $table) {
            $table->dropForeign('reg_batch_project_id_foreign');
            $table->dropForeign('reg_batch_user_id_foreign');
            $table->dropColumn('project_id');
            $table->dropColumn('next_step');
            $table->dropColumn('step_data');
            $table->dropTimestamps();
        });
    }
}<commit_msg>add counters to batch table<commit_after><?php

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

/** @noinspection AutoloadingIssuesInspection */
class AddProjectFieldsToBatchTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('reg_batch', function (Blueprint $table) {
            $table->timestamps();
            $table->unsignedInteger('project_id')->nullable()->index();
            $table->foreign('project_id')->references('id')->on('reg_agent')->onUpdate('NO ACTION')->onDelete('CASCADE');
            $table->unsignedInteger('user_id')->nullable()->index();
            $table->foreign('user_id' )->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('CASCADE');
            $table->string('next_step')->nullable();
            $table->mediumText('step_data')->nullable();
            $table->integer('total_count')->nullable();
            $table->integer('handled_count')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('reg_batch', function (Blueprint $table) {
            $table->dropForeign('reg_batch_project_id_foreign');
            $table->dropForeign('reg_batch_user_id_foreign');
            $table->dropColumn('project_id');
            $table->dropColumn('next_step');
            $table->dropColumn('step_data');
            $table->dropTimestamps();
        });
    }
}
{'fraction_non_alphanumeric': 0.1718954248366013, 'fraction_numerical': 0.0, 'mean_word_length': 2.8406524466750316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '2279109', 'n_tokens_mistral': 861, 'n_tokens_neox': 870, 'n_words': 112}