diff --git a/database/migrations/20241230082139_create_sys_operate_log.php b/database/migrations/20241230082139_create_sys_operate_log.php new file mode 100644 index 00000000..1c526d98 --- /dev/null +++ b/database/migrations/20241230082139_create_sys_operate_log.php @@ -0,0 +1,45 @@ +table('sys_operate_log', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '操作日志表']); + $table->addColumn('user_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '用户ID']) + ->addColumn('title', 'string', ['limit' => 50, 'default' => '', 'comment' => '标题']) + ->addColumn('controller', 'string', ['limit' => 50, 'default' => '', 'comment' => '控制器']) + ->addColumn('action', 'string', ['limit' => 50, 'default' => '', 'comment' => '方法']) + ->addColumn('url', 'string', ['limit' => 255, 'default' => '', 'comment' => 'URL']) + ->addColumn('ip', 'string', ['limit' => 50, 'default' => '', 'comment' => 'IP']) + ->addColumn('method', 'string', ['limit' => 10, 'default' => '', 'comment' => '请求方式']) + ->addColumn('params', 'text', ['comment' => '请求参数']) + ->addColumn('status', 'boolean', ['limit' => 1, 'default' => 1, 'comment' => '状态 1成功 0失败']) + ->addColumn('message', 'string', ['limit' => 255, 'default' => '', 'comment' => '消息']) + ->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->create(); + } +}