2025_09_18_091406_create_projects_table.php 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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->tinyInteger("badge_type")->comment("標章呈現方式");
  28. $table->integer("order");
  29. $table->timestamps();
  30. $table->softDeletes();
  31. });
  32. Schema::enableForeignKeyConstraints();
  33. }
  34. /**
  35. * Reverse the migrations.
  36. */
  37. public function down(): void
  38. {
  39. Schema::dropIfExists('projects');
  40. }
  41. };