Skip to content

Instantly share code, notes, and snippets.

@igorblumberg
Created April 4, 2016 13:08
Show Gist options
  • Save igorblumberg/701495a8654e93fb4025fa643fd80fc0 to your computer and use it in GitHub Desktop.
Save igorblumberg/701495a8654e93fb4025fa643fd80fc0 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('translations', function (Blueprint $table) {
$table->increments('id');
$table->string('model_class');
$table->string('model_id');
$table->string('key');
$table->string('locale', 2);
$table->text('value');
$table->timestamps();
$table->unique(['model_class', 'model_id','locale','key']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('translations');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment