From 4b1e28098fa85c2ec9df1ad52b875d02509b82de Mon Sep 17 00:00:00 2001 From: augushong Date: Sat, 23 Aug 2025 22:47:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .../migrations/20250823224531_system_host.php | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 database/migrations/20250823224531_system_host.php diff --git a/.gitignore b/.gitignore index 7e95115..ce34f69 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ ul.db /.VSCodeCounter result.txt test.php -/.env.prod \ No newline at end of file +/.env.prod +extend/base/common/command/curd/migrate_output.php diff --git a/database/migrations/20250823224531_system_host.php b/database/migrations/20250823224531_system_host.php new file mode 100644 index 0000000..9d69e4f --- /dev/null +++ b/database/migrations/20250823224531_system_host.php @@ -0,0 +1,48 @@ +table('system_host') + ->setComment('系统节点表') + ->addColumn('node_id', 'string', ['limit' => '100', 'null' => '0', 'comment' => '节点ID {text}', ]) + ->addColumn('ip_address', 'string', ['limit' => '45', 'null' => '1', 'comment' => 'IP地址 {text}', ]) + ->addColumn('status', 'integer', ['limit' => '1', 'null' => '0', 'default' => '1', 'comment' => '状态 {switch} (0:离线,1:在线)', ]) + ->addColumn('last_heartbeat_at', 'datetime', ['null' => '1', 'comment' => '最后心跳时间 {date}', ]) + ->addColumn('os_info', 'string', ['limit' => '255', 'null' => '1', 'comment' => '系统信息 {text}', ]) + ->addColumn('php_version', 'string', ['limit' => '50', 'null' => '1', 'comment' => 'PHP版本 {text}', ]) + ->addColumn('cpu_load', 'string', ['limit' => '50', 'null' => '1', 'comment' => 'CPU负载 {text}', ]) + ->addColumn('memory_usage', 'biginteger', ['null' => '1', 'comment' => '内存占用(byte) {text}', ]) + ->addColumn('disk_free', 'biginteger', ['null' => '1', 'comment' => '磁盘可用空间(byte) {text}', ]) + ->addColumn('disk_total', 'biginteger', ['null' => '1', 'comment' => '磁盘总空间(byte) {text}', ]) + ->addColumn('create_time', 'int unsigned', ['null' => '1', 'comment' => '首次运行时间 {date}', ]) + ->addColumn('update_time', 'int unsigned', ['null' => '1', 'comment' => '更新时间 {date}', ]) + ->addIndex('node_id',['unique'=>true]) + ->create(); + } +}