2024_11_20_100525_create_agent_project_table.php 1.3 KB

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. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('agent_project', function (Blueprint $table) {
  15. $table->comment('代理商服务项目');
  16. $table->increments('id');
  17. $table->unsignedBigInteger('cate_id')->comment('代理商项目分类ID');
  18. $table->unsignedBigInteger('project_id')->comment('项目ID');
  19. $table->decimal('price')->default(new \Illuminate\Database\Query\Expression('0.00'))->comment('项目金额');
  20. $table->integer('duration')->default(new \Illuminate\Database\Query\Expression('0'))->comment('服务时长(分钟)');
  21. $table->integer('distance')->default(new \Illuminate\Database\Query\Expression('0'))->comment('接单距离(米)');
  22. $table->string('state')->default('enable')->comment('状态(enable:启用 disable:禁用)');
  23. $table->timestamps();
  24. $table->softDeletes();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('agent_project');
  35. }
  36. };