1: <?php
2:
3: use Illuminate\Database\Schema\Blueprint;
4: use Illuminate\Database\Migrations\Migration;
5:
6: class extends Migration {
7:
8: 9: 10: 11: 12:
13: public function up()
14: {
15: if (!Schema::hasTable('_db_menus'))
16: {
17: Schema::create('_db_menus', function(Blueprint $table)
18: {
19: $table->increments('id');
20: $table->string('icon_class')->nullable();
21: $table->string('label');
22: $table->integer('weight')->default(0);
23: $table->string('href')->nullable();
24: $table->integer('parent_id')->nullable();
25: $table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
26: $table->timestamp('updated_at')->default('0000-00-00 00:00:00');
27: });
28: }
29: }
30:
31: 32: 33: 34: 35:
36: public function down()
37: {
38: Schema::dropIfExists('_db_menus');
39: }
40:
41: }