2024_11_18_040034_create_project_table.php 1.6 KB

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. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('project', function (Blueprint $table) {
  15. $table->comment('项目服务');
  16. $table->increments('id');
  17. $table->unsignedBigInteger('cate_id')->comment('项目分类编号');
  18. $table->string('cover')->nullable()->comment('项目封面');
  19. $table->string('title')->default('')->comment('项目标题');
  20. $table->string('subtitle')->nullable()->comment('项目副标题');
  21. $table->decimal('price')->comment('项目金额');
  22. $table->decimal('original_price')->comment('项目原价');
  23. $table->integer('sales')->default(new \Illuminate\Database\Query\Expression('0'))->nullable()->comment('虚拟销量');
  24. $table->integer('duration')->comment('服务时长');
  25. $table->text('project_desc')->nullable()->comment('项目介绍');
  26. $table->text('service_desc')->nullable()->comment('服务说明');
  27. $table->string('type')->default('')->comment('服务类型');
  28. $table->string('state')->default('ENABLE')->comment('状态');
  29. $table->timestamps();
  30. $table->softDeletes();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('project');
  41. }
  42. };