mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 12:45:32 +08:00
fix(migration): 新增增量 migration 补齐 timer_config 与 system_host 缺失字段
建表 migration(SystemTimerConfig/SystemHost)建表时未含动态管控新增字段(trigger_node_id/last_trigger_time/concurrency/is_master),全新安装走 migrate:run 会缺字段。新增 ALTER migration 增量补齐,保证全新安装表结构完整。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
|
||||
/**
|
||||
* 增量补字段:定时器动态管控 + 主节点标记
|
||||
*
|
||||
* 这些字段在 Scheme 和 adminUpdateCodeData/v2.3.0.php 分发代码中已存在,
|
||||
* 但建表 migration(SystemTimerConfig / SystemHost)建表时未含,
|
||||
* 全新安装走 migrate:run 会导致表结构缺字段。
|
||||
* 本 migration 以 ALTER TABLE 增量补齐,保证全新安装完整。
|
||||
*/
|
||||
class AddTimerDynamicControlFields extends Migrator
|
||||
{
|
||||
public function change()
|
||||
{
|
||||
// system_timer_config 补动态管控3字段
|
||||
$this->table('system_timer_config')
|
||||
->addColumn('trigger_node_id', 'string', ['limit' => 100, 'null' => true, 'comment' => '手动触发目标节点ID'])
|
||||
->addColumn('last_trigger_time', 'integer', ['limit' => 11, 'null' => true, 'comment' => '手动触发设置时间戳,用于TTL自动复位', 'signed' => false])
|
||||
->addColumn('concurrency', 'integer', ['limit' => 4, 'null' => true, 'comment' => '并发数:NULL=继承代码默认'])
|
||||
->update();
|
||||
|
||||
// system_host 补主节点标记
|
||||
$this->table('system_host')
|
||||
->addColumn('is_master', 'integer', ['limit' => 4, 'default' => 0, 'comment' => '是否主节点:0=否,1=是'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user