home-erp

git clone git://archive.git.mtrnord.blog/MTRNord/home-erp.git
Log | Files | Refs | README

2023_10_18_145921_create_cabinets_table.php (687B)


      1 <?php
      2 
      3 use \App\Models\Room;
      4 use Illuminate\Database\Migrations\Migration;
      5 use Illuminate\Database\Schema\Blueprint;
      6 use Illuminate\Support\Facades\Schema;
      7 
      8 return new class extends Migration {
      9     /**
     10      * Run the migrations.
     11      */
     12     public function up(): void
     13     {
     14         Schema::create('cabinets', function (Blueprint $table) {
     15             $table->uuid('id');
     16             $table->timestamps();
     17             $table->string("name");
     18             $table->string("description");
     19             $table->foreignIdFor(Room::class);
     20         });
     21     }
     22 
     23     /**
     24      * Reverse the migrations.
     25      */
     26     public function down(): void
     27     {
     28         Schema::dropIfExists('cabinets');
     29     }
     30 };