From ebfba1b1787a1bbd080e4b81cbd2add7a0052482 Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Fri, 25 Feb 2022 17:10:43 +0800 Subject: [PATCH] update: sql --- database/install.sql | 7 +++++-- database/update.sql | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/database/install.sql b/database/install.sql index 5e7231e2..c45c1a29 100644 --- a/database/install.sql +++ b/database/install.sql @@ -322,7 +322,10 @@ CREATE TABLE `v2_stat_user` ( `record_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `server_id` (`server_id`), + KEY `user_id` (`user_id`), + KEY `record_at` (`record_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; @@ -390,4 +393,4 @@ CREATE TABLE `v2_user` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- 2022-02-23 07:42:04 +-- 2022-02-25 09:10:24 diff --git a/database/update.sql b/database/update.sql index 8f24e584..66e529c9 100644 --- a/database/update.sql +++ b/database/update.sql @@ -508,3 +508,8 @@ CREATE TABLE `v2_stat_user` ( ALTER TABLE `v2_payment` ADD `notify_domain` varchar(128) COLLATE 'utf8mb4_general_ci' NULL AFTER `config`; + +ALTER TABLE `v2_stat_user` + ADD INDEX `server_id` (`server_id`), +ADD INDEX `user_id` (`user_id`), +ADD INDEX `record_at` (`record_at`);