2024_11_20_133233_create_coach_project_table.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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('coach_project', function (Blueprint $table) {
  15. $table->comment('技师开通服务项目');
  16. $table->increments('id');
  17. $table->unsignedBigInteger('coach_id')->comment('技师ID');
  18. $table->unsignedBigInteger('project_id')->comment('项目ID');
  19. $table->decimal('discount_amount')->default(new \Illuminate\Database\Query\Expression('0.00'))->comment('优惠金额');
  20. $table->string('service_gender')->default('all')->comment('服务性别(all:不限 male:男 female:女)');
  21. $table->integer('service_distance')->default(new \Illuminate\Database\Query\Expression('0'))->comment('服务距离(米)');
  22. $table->string('traffic_fee_type')->default('free')->comment('收取路费(free:免费 one_way:单程 round_trip:双程)');
  23. $table->decimal('traffic_fee')->default(new \Illuminate\Database\Query\Expression('0.00'))->comment('路费金额');
  24. $table->string('state')->default('enable')->comment('状态(enable:启用 disable:禁用)');
  25. $table->timestamps();
  26. $table->softDeletes();
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('coach_project');
  37. }
  38. };