d2d.emegrendeles.hu/database/migrations/2021_11_26_053327_create_addresses_table.php

40 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('addresses', function (Blueprint $table) {
$table->id();
$table->string('postCode')->nullable();
$table->string('city')->nullable();
$table->string('street');
$table->string('note')->nullable();
$table->string('name')->nullable();
$table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
$table->boolean('canSee')->default(true);
$table->integer('attachable_id')->unsigned()->nullable();
$table->string('attachable_type')->nullable();
$table->timestamps();
$table->softDeletes();
$table->userIdFields();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('addresses');
}
};