2025_09_18_091406_create_projects_table.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::disableForeignKeyConstraints();
  13. Schema::create('projects', function (Blueprint $table) {
  14. $table->id();
  15. $table->foreignId('region_id')->references('id')->on('regions')->comment('所屬地區');
  16. $table->json("name")->comment("專案項目名稱");
  17. $table->json("address")->comment("基本資料: 地址");
  18. $table->json("floor_plan")->comment("樓層規劃");
  19. $table->json("building_structure")->comment("建築結構");
  20. $table->json("design_unit")->comment("設計團隊");
  21. $table->json("contact_info")->comment("聯絡資訊");
  22. $table->timestamps();
  23. $table->softDeletes();
  24. });
  25. Schema::enableForeignKeyConstraints();
  26. }
  27. /**
  28. * Reverse the migrations.
  29. */
  30. public function down(): void
  31. {
  32. Schema::dropIfExists('projects');
  33. }
  34. };