| 1 | <?php |
||
| 7 | class CreateLevelsTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('levels', function (Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | $table->string('name')->unique(); |
||
| 19 | $table->string('label')->nullable(); |
||
| 20 | $table->text('description')->nullable(); |
||
| 21 | $table->integer('rank')->unsigned(); |
||
| 22 | $table->timestamps(); |
||
| 23 | |||
| 24 | $table->index('name'); |
||
| 25 | $table->index('rank'); |
||
| 26 | }); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Reverse the migrations. |
||
| 31 | * |
||
| 32 | * @return void |
||
| 33 | */ |
||
| 34 | public function down() |
||
| 35 | { |
||
| 36 | Schema::dropIfExists('levels'); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |