38 lines
919 B
PHP
38 lines
919 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration {
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('group', function (Blueprint $table) {
|
|
$table->id()->autoIncrement();
|
|
$table->string('name', 255)->nullable();
|
|
$table->integer('type_id')->default(0)->index();
|
|
$table->string('slug')->nullable()->unique();
|
|
$table->tinyInteger('status')->default(1);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('group', function (Blueprint $table) {
|
|
$table->dropForeign('type_id');
|
|
$table->drop();
|
|
});
|
|
}
|
|
};
|