Created
April 27, 2017 11:00
-
-
Save fearrr/ed3dc04d260da9e2e7a8189bd73c604d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function up() | |
{ | |
Schema::create('categories', function (Blueprint $table){ | |
$table->increments('id'); | |
$table->string('slug')->nullable(); | |
$table->string('old_redirect')->nullable(); | |
$table->string('name')->nullable(); | |
$table->string('short_desc')->nullable(); | |
$table->text('full_desc')->nullable(); | |
$table->string('img_sm')->nullable(); | |
$table->string('img_md')->nullable(); | |
$table->string('img_lg')->nullable(); | |
$table->unsignedTinyInteger('priority'); | |
$table->unsignedTinyInteger('type'); | |
$table->boolean('active')->default(true); | |
$table->timestamps(); | |
NestedSet::columns($table); | |
$table->unique(['parent_id', 'slug']); | |
}); | |
} | |
public function down() | |
{ | |
Schema::table('categories', function (Blueprint $table) { | |
NestedSet::dropColumns($table); | |
}); | |
Schema::dropIfExists('categories'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment