<commit_before><?php

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

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

            // Non-translated content
            $table->integer('country_id')->unsigned()->nullable(); // ID of country
            $table->integer('city_id')->unsigned()->nullable(); // ID of city
            $table->integer('image_id')->unsigned()->nullable(); // ID of image
            $table->string('type'); // Shop, gallery, studio, etc.
            $table->string('address');
            $table->string('email');
            $table->string('phone');
            $table->integer('user_id')->unsigned()->nullable(); // Who own this place page

            // Timestamps
            $table->timestamps();
            $table->softDeletes();

            // Foreign keys, when delete country, city, image, user, set columns to null
            $table->foreign('country_id')->references('id')->on('country')->onDelete('set null');
            $table->foreign('city_id')->references('id')->on('city')->onDelete('set null');
            $table->foreign('image_id')->references('id')->on('image')->onDelete('set null');
            $table->foreign('user_id')->references('id')->on('user')->onDelete('set null');
        });
        Schema::create('place_translation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('place_id')->unsigned();
            $table->string('language')->index();
            $table->boolean('complete');

            // Translated content
            $table->string('name');
            $table->text('content');

            $table->timestamps();

            // Unique and foreign key
            // When deleting city model, also delete all translation models
            $table->unique(['place_id','language']);
            $table->foreign('place_id')->references('id')->on('place')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('place_translation');
        Schema::drop('place');
    }
}
<commit_msg>Add location and website columns to place table.<commit_after><?php

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

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

            // Non-translated content
            $table->integer('country_id')->unsigned()->nullable(); // ID of country
            $table->integer('city_id')->unsigned()->nullable(); // ID of city
            $table->integer('image_id')->unsigned()->nullable(); // ID of image
            $table->string('type'); // Shop, gallery, studio, etc.
            $table->string('address');
            $table->string('email');
            $table->string('phone');
            $table->string('website');
            $table->integer('user_id')->unsigned()->nullable(); // Who own this place page

            // Timestamps
            $table->timestamps();
            $table->softDeletes();

            // Foreign keys, when delete country, city, image, user, set columns to null
            $table->foreign('country_id')->references('id')->on('country')->onDelete('set null');
            $table->foreign('city_id')->references('id')->on('city')->onDelete('set null');
            $table->foreign('image_id')->references('id')->on('image')->onDelete('set null');
            $table->foreign('user_id')->references('id')->on('user')->onDelete('set null');
        });

        DB::statement('ALTER TABLE place ADD location POINT AFTER city_id' );

        Schema::create('place_translation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('place_id')->unsigned();
            $table->string('language')->index();
            $table->boolean('complete');

            // Translated content
            $table->string('name');
            $table->text('content');

            $table->timestamps();

            // Unique and foreign key
            // When deleting city model, also delete all translation models
            $table->unique(['place_id','language']);
            $table->foreign('place_id')->references('id')->on('place')->onDelete('cascade');
        });
    }

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

{'fraction_non_alphanumeric': 0.1826015592942142, 'fraction_numerical': 0.0, 'mean_word_length': 2.3073270013568523, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 102, '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': '1216192', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1250, 'n_words': 238}