Files
webman-buildadmin/database/migrations/20260402120000_game_user_tier_bigwin_ticket.php
2026-04-10 16:10:01 +08:00

40 lines
1.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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();
}
}