/** * Run the migrations. * * @return void */ public function up() { Schema::create('pages', function (Blueprint $table) { $table->increments('id'); $table->string('slug'); $table->boolean('hide')->default(false); $table->boolean('show_in_footer_navigation')->default(false); $table->boolean('show_in_main_navigation')->default(true); $table->timestamps(); NestedSet::columns($table); }); Schema::create('page_translations', function (Blueprint $table) { $table->increments('id'); $table->integer('page_id')->unsigned(); $table->string('title'); $table->string('browser_title')->nullable(); $table->mediumText('meta_description')->nullable(); $table->mediumText('meta_keywords')->nullable(); $table->mediumText('html_content')->nullable(); $table->string('locale')->index(); $table->timestamps(); $table->unique(['page_id', 'locale'], 'page_trans_parent_loc_unique'); $table->foreign('page_id', 'page_trans_foreign')->references('id')->on('pages')->onUpdate('cascade')->onDelete('cascade'); }); }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id'); $table->string('title', 75); $table->string('description', 255); NestedSet::columns($table); }); }
public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->text('description')->nullable(); $table->string('slug'); NestedSet::columns($table); $table->timestamps(); }); Schema::create('categories_relations', function (Blueprint $table) { $table->integer('category_id'); $table->morphs('categorizable'); $table->timestamps(); }); }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('alias')->nullable(); $table->text('description')->nullable(); $table->integer('order')->default(0); $table->integer('status')->default(1); $table->softDeletes(); $table->timestamps(); NestedSet::columns($table); if ($fields = Config::get('category.custom_fields')) { foreach ($fields as $key => $value) { $table->{$value}($key); } } }); }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id'); $table->string('title'); //$table->integer('_lft')->index(); //$table->integer('_rgt')->index(); //$table->integer('parent_id')->index()->unsigned()->nullable(); $table->string('slug'); $table->integer('level'); $table->string('path'); $table->tinyInteger('is_link'); $table->string('type')->index(); $table->integer('hits'); NestedSet::columns($table); // Performs all actions at the commented lines $table->timestamps(); }); NestedSet::createRoot('categories', array('title' => 'root')); // Schema::table('categories', function($table) { // $table->foreign('parent_id')->references('id')->on('categories'); // }); }