28 lines
898 B
PHP
28 lines
898 B
PHP
<?php
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('buildings', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('owner_id')->constrained('owners')->onDelete('cascade');
|
|
$table->string('building_name');
|
|
$table->text('address');
|
|
$table->string('city');
|
|
$table->string('status')->default('vacant');
|
|
$table->timestamps();
|
|
$table->foreignId('created_by')->nullable()->constrained('users');
|
|
$table->foreignId('updated_by')->nullable()->constrained('users');
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('buildings');
|
|
}
|
|
}; |