mysql数据库

This commit is contained in:
2026-04-10 16:10:01 +08:00
parent ec6bd3ede5
commit 096516ba33

View File

@@ -0,0 +1,39 @@
<?php
use Phinx\Migration\AbstractMigration;
/**
* game_user档位权重、中大奖权重、抽奖券数量JSON 文本)
*/
class GameUserTierBigwinTicket extends AbstractMigration
{
public function change(): void
{
if (!$this->hasTable('game_user')) {
return;
}
$table = $this->table('game_user');
if (!$table->hasColumn('tier_weight')) {
$table->addColumn('tier_weight', 'text', [
'null' => true,
'default' => null,
'comment' => '档位权重 JSON如 [{"T1":"5"},{"T2":"20"}]',
]);
}
if (!$table->hasColumn('bigwin_weight')) {
$table->addColumn('bigwin_weight', 'text', [
'null' => true,
'default' => null,
'comment' => '中大奖权重 JSON',
]);
}
if (!$table->hasColumn('ticket_count')) {
$table->addColumn('ticket_count', 'text', [
'null' => true,
'default' => null,
'comment' => '抽奖券 JSON如 [{"ante":1,"count":1}]',
]);
}
$table->update();
}
}