<commit_before><?php

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

class CreateTagTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tag', function (Blueprint $table) {
            $table->increments('id');

            // Name in URL, lowercase, e.g. "chair", "solid-wood"
            $table->string('slug')->unique();

            // Icon/cover image
            $table->integer('image_id')->unsigned();

            // Timestamps
            $table->timestamps();

            // Foreign key
            $table->foreign('image_id')->references('id')->on('image')->onDelete('set null');
        });

        Schema::create('tag_translation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('tag_id')->unsigned();
            $table->string('locale');

            // Translated content
            $table->string('name');
            $table->string('alias')->nullable(); // For better search matches

            $table->timestamps();

            // Unique
            $table->unique(['tag_id','locale']);
            // Foreign key
            $table->foreign('tag_id')->references('id')->on('tag')->onDelete('cascade');
        });
    }

    /**<commit_msg>image_id nullable.<commit_after><?php

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

class CreateTagTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tag', function (Blueprint $table) {
            $table->increments('id');

            // Name in URL, lowercase, e.g. "chair", "solid-wood"
            $table->string('slug')->unique();

            // Icon/cover image
            $table->integer('image_id')->unsigned()->nullable();

            // Timestamps
            $table->timestamps();

            // Foreign key
            $table->foreign('image_id')->references('id')->on('image')->onDelete('set null');
        });

        Schema::create('tag_translation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('tag_id')->unsigned();
            $table->string('locale');

            // Translated content
            $table->string('name');
            $table->string('alias')->nullable(); // For better search matches

            $table->timestamps();

            // Unique
            $table->unique(['tag_id','locale']);
            // Foreign key
            $table->foreign('tag_id')->references('id')->on('tag')->onDelete('cascade');
        });
    }

    /**
{'fraction_non_alphanumeric': 0.17858452511917858, 'fraction_numerical': 0.0, 'mean_word_length': 1.9781659388646289, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 50, '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': '3136992', 'n_tokens_mistral': 737, 'n_tokens_neox': 723, 'n_words': 121}