2025_09_18_091406_create_projects_table.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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("sub_name")->comment("副標名稱");
  18. $table->json("summaries")->comment("專案概要");
  19. $table->json('img_url')->nullable()->comment('列表圖');
  20. $table->json("address")->comment("基本資料: 地址");
  21. $table->json("floor_plan")->comment("樓層規劃");
  22. $table->json("building_structure")->comment("建築結構");
  23. $table->json("design_unit")->comment("設計團隊");
  24. $table->json("contact_unit")->comment("物管單位");
  25. $table->json("contact_phone")->comment("物管電話");
  26. $table->json("inversment_phone")->comment("招商電話");
  27. $table->unsignedInteger('order')->default(0)->comment("排序");
  28. $table->timestamps();
  29. $table->softDeletes();
  30. });
  31. Schema::enableForeignKeyConstraints();
  32. }
  33. /**
  34. * Reverse the migrations.
  35. */
  36. public function down(): void
  37. {
  38. Schema::dropIfExists('projects');
  39. }
  40. };