translateable cms pages

This commit is contained in:
Arno Kaimbacher 2018-09-13 14:03:17 +02:00
parent ee8584a2d5
commit 0457e65565
8 changed files with 244 additions and 10 deletions

View file

@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePageTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('page_translations', function (Blueprint $table) {
$table->increments('id');
$table->integer('page_id')->unsigned();
$table->string('locale')->index();
$table->string('title');
$table->text('description');
$table->unique(['page_id','locale']);
$table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('page_translations');
}
}