39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
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('contacts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name')->nullable();
|
|
$table->string('phone')->nullable();
|
|
$table->string('email')->nullable();
|
|
$table->text('note')->nullable();
|
|
$table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
|
|
$table->boolean('canSee')->default(true);
|
|
$table->integer('contactable_id')->unsigned()->nullable();
|
|
$table->string('contactable_type')->nullable();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
$table->userIdFields();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('contacts');
|
|
}
|
|
};
|