37 lines
967 B
PHP
37 lines
967 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use App\Enums\DbStatusFieldEnum;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('producers', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name')->nullable();
|
|
$table->text('note')->nullable();
|
|
$table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
|
|
$table->boolean('canSee')->default(true);
|
|
$table->unique('id', 'name');
|
|
$table->index('name');
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
$table->userIdFields();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('producers');
|
|
}
|
|
};
|