first commit
This commit is contained in:
29
database/migrations/2026_01_10_000004_create_units_table.php
Normal file
29
database/migrations/2026_01_10_000004_create_units_table.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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('units', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('building_id')->constrained('buildings')->onDelete('cascade');
|
||||
$table->string('unit_no');
|
||||
$table->string('floor_no')->nullable();
|
||||
$table->integer('area_sqft')->nullable();
|
||||
$table->json('assets')->nullable();
|
||||
$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('units');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user