34 lines
747 B
PHP
34 lines
747 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateDisksTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('disks', function (Blueprint $table) {
|
|
$table->unsignedTinyInteger('id')->primary();
|
|
$table->string('name', 40)->unique()->comment('名稱');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
DB::statement('SET FOREIGN_KEY_CHECKS = 0');
|
|
Schema::dropIfExists('disks');
|
|
DB::statement('SET FOREIGN_KEY_CHECKS = 1');
|
|
}
|
|
}
|