Commit 810f33d1 authored by Nicolas Widart's avatar Nicolas Widart

Adding menuitems migrations

parent 07a5874b
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMenuitemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menuitems', function(Blueprint $table) {
$table->increments('id');
$table->integer('menu_id')->unsigned();
$table->foreign('menu_id')->references('id')->on('menus')->onDelete('cascade');
$table->integer('page_id')->unsigned();
$table->string('target');
$table->string('module_name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('menuitems');
}
}
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMenuitemTranslationTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menuitem_translations', function(Blueprint $table) {
$table->increments('id');
$table->integer('menuitem_id')->unsigned();
$table->string('locale')->index();
$table->integer('status');
$table->string('title');
$table->string('url');
$table->string('uri');
$table->unique(['menuitem_id', 'locale']);
$table->foreign('menuitem_id')->references('id')->on('menuitems')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('menuitem_translations');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment