table('xhprof_watch', ['id' => false, 'primary_key' => ['id']]) ->setComment('XHProf 函数监控规则') ->addColumn('id', 'integer', ['limit' => 11, 'null' => false, 'signed' => false, 'identity' => true, 'comment' => '主键ID']) ->addColumn('name', 'string', ['limit' => 100, 'null' => false, 'comment' => '规则名称(人读)']) ->addColumn('regex', 'string', ['limit' => 255, 'null' => false, 'comment' => 'PCRE 正则(对被调用函数名匹配)']) ->addColumn('note', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '备注']) ->addColumn('threshold_ms', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '比对阈值(毫秒),0=不比对']) ->addColumn('status', 'tinyinteger', ['limit' => 4, 'default' => 1, 'comment' => '状态:1=启用,0=禁用']) ->addColumn('create_time', 'integer', ['limit' => 11, 'comment' => '创建时间戳', 'signed' => false]) ->addColumn('update_time', 'integer', ['limit' => 11, 'comment' => '更新时间戳', 'signed' => false]) ->addIndex(['regex'], ['unique' => true, 'name' => 'uniq_regex']) ->create(); } }