|
|
@@ -0,0 +1,27 @@
|
|
|
+<?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('unit_contracts', function (Blueprint $table) {
|
|
|
+ $table->id();
|
|
|
+ $table->foreignId('unit_id')->constrained('units')->cascadeOnDelete();
|
|
|
+ $table->string('name');
|
|
|
+ $table->string('file_url');
|
|
|
+ $table->timestamps();
|
|
|
+ $table->softDeletes();
|
|
|
+
|
|
|
+ $table->index('unit_id');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public function down(): void
|
|
|
+ {
|
|
|
+ Schema::dropIfExists('unit_contracts');
|
|
|
+ }
|
|
|
+};
|