Skip to content

Commit ff7f8b8

Browse files
committed
add menu items table migration to cms example
1 parent 352b2eb commit ff7f8b8

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateMenuItemsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('menu_items', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->string('text');
19+
$table->string('path');
20+
$table->integer('parent_menu_item_id')->unsigned()->nullable();
21+
$table->foreign('parent_menu_item_id')->references('id')->on('menu_items');
22+
$table->integer('order')->unsigned()->nullable();
23+
$table->boolean('active')->default(true);
24+
});
25+
}
26+
27+
/**
28+
* Reverse the migrations.
29+
*
30+
* @return void
31+
*/
32+
public function down()
33+
{
34+
//
35+
}
36+
}

0 commit comments

Comments
 (0)