2026_07_08_120000_create_egame_items_table.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. public function up()
  7. {
  8. if (Schema::hasTable('egame_items')) {
  9. return;
  10. }
  11. Schema::create('egame_items', function (Blueprint $table) {
  12. $table->id();
  13. $table->string('item_type', 16)->comment('platform/game');
  14. $table->string('plat_type', 32)->comment('三方平台代码');
  15. $table->unsignedTinyInteger('game_type')->default(0)->comment('游戏类型');
  16. $table->string('game_code', 128)->default('')->comment('三方游戏代码,平台行为空');
  17. $table->string('name', 128)->default('')->comment('展示名称');
  18. $table->string('ingress', 16)->default('3')->comment('1电脑 2手机 3通用');
  19. $table->string('logo', 500)->default('')->comment('平台logo/游戏square图');
  20. $table->json('logo_langs')->nullable()->comment('游戏多语言square图');
  21. $table->unsignedTinyInteger('status')->default(1)->comment('1开启 0关闭');
  22. $table->integer('sort')->default(0)->comment('排序,越大越靠前');
  23. $table->timestamps();
  24. $table->unique(['item_type', 'plat_type', 'game_type', 'game_code'], 'uniq_egame_item');
  25. $table->index(['item_type', 'plat_type', 'game_type', 'status'], 'idx_egame_item_query');
  26. });
  27. }
  28. public function down()
  29. {
  30. Schema::dropIfExists('egame_items');
  31. }
  32. };