2026_03_04_173221_create_sports_table.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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::create('sports', function (Blueprint $table) {
  13. $table->id();
  14. $table->integer('data_id')->default(0)->comment('赛事数据id');
  15. $table->integer('home_team_id')->nullable()->default(0)->comment('主队球队数据id');
  16. $table->string('home_team_en', 200)->nullable()->comment('主队英文名');
  17. $table->string('home_team', 200)->nullable()->comment('主队');
  18. $table->string('home_team_logo', 200)->nullable()->comment('主队logo');
  19. $table->integer('guest_team_id')->nullable()->default(0)->comment('客队球队数据id');
  20. $table->string('guest_team_en', 200)->nullable()->comment('客队英文名');
  21. $table->string('guest_team', 200)->nullable()->comment('客队');
  22. $table->string('guest_team_logo', 200)->nullable()->comment('客队logo');
  23. $table->string('half_score', 100)->nullable()->default('0-0')->comment('半场比分');
  24. $table->string('rbt', 20)->nullable()->comment('比赛时间'); // 建议改名 match_time 或 match_datetime
  25. $table->tinyInteger('is_roll')->nullable()->default(0)->comment('是否滚球');
  26. $table->string('score', 100)->nullable()->default('0-0')->comment('全场比分');
  27. $table->string('league_en', 200)->nullable()->comment('联赛英文名');
  28. $table->string('league', 200)->nullable()->comment('联赛');
  29. $table->mediumText('odds')->nullable()->comment('赔率');
  30. $table->integer('state')->default(0)->comment('比赛状态:0未开始1进行中2已完场3延期4取消');
  31. $table->integer('game_time')->default(0)->comment('比赛时间');
  32. $table->tinyInteger('status')->default(0)->comment('状态:1上架0下架-1删除');
  33. $table->string('handicap_limit', 30)->nullable()->default('1-7000')->comment('让球限额');
  34. $table->string('over_under_limit', 30)->nullable()->default('1-7000')->comment('大小限额');
  35. $table->string('duying_limit', 30)->nullable()->default('1-2800')->comment('独赢,胜负平限额');
  36. $table->string('correct_core_limit', 30)->nullable()->default('1-700')->comment('波胆限额');
  37. $table->string('odd_even_limit', 30)->nullable()->default('1-7000')->comment('单双限额');
  38. $table->string('total_goal_limit', 30)->nullable()->default('1-3500')->comment('总进球限额');
  39. $table->tinyInteger('is_handicap')->nullable()->default(1);
  40. $table->tinyInteger('is_over_under')->nullable()->default(1);
  41. $table->tinyInteger('is_duying')->nullable()->default(1);
  42. $table->tinyInteger('is_correct_core')->nullable()->default(1);
  43. $table->tinyInteger('is_odd_even')->nullable()->default(1);
  44. $table->tinyInteger('is_total_goal')->nullable()->default(1);
  45. // $table->integer('create_time')->default(0)->comment('创建时间');
  46. // $table->integer('update_time')->default(0)->comment('更新时间');
  47. $table->tinyInteger('is_locked')->nullable()->default(0)->comment('是否加锁');
  48. $table->timestamps();
  49. // 索引
  50. $table->index('data_id');
  51. $table->index('game_time');
  52. $table->index('league');
  53. });
  54. }
  55. /**
  56. * Reverse the migrations.
  57. */
  58. public function down(): void
  59. {
  60. Schema::dropIfExists('sports');
  61. }
  62. };