feat(admin): XHProf 性能日志五张表 Scheme 迁移与模型

This commit is contained in:
augushong
2026-08-14 22:04:52 +08:00
parent da388a8c4f
commit 7e73902325
15 changed files with 478 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
use think\migration\Migrator;
use Phinx\Db\Adapter\MysqlAdapter;
/**
* XHProf 性能日志 - 采样原始 profile 数据表
*
* 显式豁免表:不进后台(无 CURD 页面)、无 create_time 等约定字段、无额外索引。
* id 与 ul_xhprof_run.id 一一对应(非自增),查询入口即主键。
*/
class XhprofRunDetail extends Migrator
{
public function change()
{
$table = $this->table('xhprof_run_detail', ['id' => false, 'primary_key' => ['id']])
->setComment('XHProf 采样原始 profile 数据(按 run 1:1不进后台')
->addColumn('id', 'integer', ['limit' => 11, 'null' => false, 'signed' => false, 'comment' => '主键,值=ul_xhprof_run.id不自增'])
->addColumn('profile_data', 'text', ['length' => MysqlAdapter::TEXT_LONG, 'null' => true, 'comment' => '原始 profile JSON'])
->create();
}
}