🎨新增方法注释

This commit is contained in:
coward 2024-03-11 15:50:13 +08:00
parent 71d6090f94
commit 1369f3e331
2 changed files with 378 additions and 0 deletions

View File

@ -3994,3 +3994,376 @@
[2024-03-11 14:45:33.161] INFO callbacks/preload.go:261 [507.6µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 14:45:33.161] INFO repository/server.go:37 [1.3902ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 14:45:33.161] INFO repository/system.go:28 [532.6µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 14:48:25.310] INFO sqlite@v1.5.5/migrator.go:32 [532.9µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 14:48:25.322] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 14:48:25.323] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 14:48:25.323] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 14:48:25.323] INFO sqlite@v1.5.5/migrator.go:368 [502.4µs] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 14:48:25.325] INFO sqlite@v1.5.5/migrator.go:413 [1.1725ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 14:48:25.325] INFO sqlite@v1.5.5/migrator.go:423 [527.3µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 14:48:25.325] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 14:48:25.326] INFO sqlite@v1.5.5/migrator.go:423 [651.2µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 14:48:25.328] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 14:48:25.328] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 14:48:25.329] INFO sqlite@v1.5.5/migrator.go:413 [590µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 14:48:25.330] INFO sqlite@v1.5.5/migrator.go:423 [602µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 14:48:25.330] INFO sqlite@v1.5.5/migrator.go:423 [581.1µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 14:48:25.331] INFO sqlite@v1.5.5/migrator.go:423 [945.2µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 14:48:25.333] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 14:48:25.333] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 14:48:25.333] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 14:48:25.333] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 14:48:25.333] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 14:48:25.334] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 14:48:25.335] INFO sqlite@v1.5.5/migrator.go:423 [1.1028ms] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 14:48:25.336] INFO sqlite@v1.5.5/migrator.go:423 [564.7µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 14:48:25.337] INFO sqlite@v1.5.5/migrator.go:423 [1.0686ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 14:48:25.339] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 14:48:25.339] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 14:48:25.339] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 14:48:25.339] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 14:48:25.340] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 14:48:25.341] INFO sqlite@v1.5.5/migrator.go:413 [1.0587ms] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 14:48:25.341] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 14:48:25.341] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 14:48:25.343] INFO sqlite@v1.5.5/migrator.go:423 [1.124ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 14:48:25.344] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 14:48:25.344] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 14:48:25.345] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 14:48:25.346] INFO sqlite@v1.5.5/migrator.go:423 [81.3µs] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 14:48:25.346] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 14:48:25.349] INFO sqlite@v1.5.5/migrator.go:423 [2.2094ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 14:48:25.350] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 14:48:25.350] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 14:48:25.350] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 14:48:25.350] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 14:48:25.351] INFO sqlite@v1.5.5/migrator.go:125 [1.5459ms] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 14:48:25.351] INFO script/script.go:61 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 14:48:25.351] INFO script/script.go:98 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 14:48:30.155] INFO repository/user.go:44 [433.5µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 14:48:30.158] INFO repository/server.go:63 [2.618ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 14:48:30.155" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 14:48:30.177] INFO callbacks/preload.go:261 [0s] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 14:48:30.177] INFO callbacks/preload.go:261 [504.2µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 14:48:30.178] INFO repository/server.go:37 [1.6475ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 14:48:30.179] INFO repository/system.go:28 [521.4µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 14:48:45.903] INFO repository/user.go:44 [603.2µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 14:48:45.903] INFO repository/client.go:33 [504.5µs] [rows:2] SELECT twc.id,twc.created_at,twc.updated_at,twc.name,twc.email,twc.subnet_range,twc.ip_allocation,twc.allowed_ips,twc.extra_allowed_ips,twc.endpoint,twc.use_server_dns,twc.enable_after_creation,twc.enabled,twc.keys as keys_str,tu.name as create_user FROM t_wg_client as twc LEFT JOIN t_user as tu ON twc.user_id = tu.id LIMIT 10
[2024-03-11 14:48:45.904] INFO repository/client.go:33 [521.5µs] [rows:1] SELECT count(*) FROM t_wg_client as twc LEFT JOIN t_user as tu ON twc.user_id = tu.id
[2024-03-11 15:20:19.427] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 15:20:19.440] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:19.440] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 15:20:19.442] INFO sqlite@v1.5.5/migrator.go:79 [1.5461ms] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:19.442] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:20:19.444] INFO sqlite@v1.5.5/migrator.go:413 [1.1123ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:20:19.444] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:20:19.444] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:20:19.445] INFO sqlite@v1.5.5/migrator.go:423 [1.1598ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:20:19.447] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:19.448] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:20:19.448] INFO sqlite@v1.5.5/migrator.go:413 [607.6µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:20:19.449] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:20:19.449] INFO sqlite@v1.5.5/migrator.go:423 [602.5µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:20:19.451] INFO sqlite@v1.5.5/migrator.go:423 [1.2027ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:20:19.453] INFO sqlite@v1.5.5/migrator.go:32 [54.2µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 15:20:19.453] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:19.454] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 15:20:19.454] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:19.454] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 15:20:19.455] INFO sqlite@v1.5.5/migrator.go:413 [534µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 15:20:19.456] INFO sqlite@v1.5.5/migrator.go:423 [67.2µs] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 15:20:19.456] INFO sqlite@v1.5.5/migrator.go:423 [555.1µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 15:20:19.458] INFO sqlite@v1.5.5/migrator.go:423 [1.7243ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 15:20:19.460] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 15:20:19.460] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:19.460] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 15:20:19.461] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:19.461] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:20:19.463] INFO sqlite@v1.5.5/migrator.go:413 [1.0465ms] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:20:19.463] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:20:19.463] INFO sqlite@v1.5.5/migrator.go:423 [532.2µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:20:19.465] INFO sqlite@v1.5.5/migrator.go:423 [1.6818ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:20:19.467] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:19.468] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:20:19.469] INFO sqlite@v1.5.5/migrator.go:413 [504.3µs] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:20:19.469] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:20:19.470] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:20:19.471] INFO sqlite@v1.5.5/migrator.go:423 [1.5696ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:20:19.474] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 15:20:19.474] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 15:20:19.474] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 15:20:19.475] INFO migrator/migrator.go:73 [1.0049ms] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:19.475] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 15:20:19.475] INFO script/script.go:61 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 15:20:19.475] INFO script/script.go:98 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 15:20:25.702] INFO repository/user.go:44 [110.9µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:20:25.705] INFO repository/server.go:63 [2.1023ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:20:25.703" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:20:25.725] INFO callbacks/preload.go:261 [0s] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:20:25.725] INFO callbacks/preload.go:261 [1.0321ms] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:20:25.725] INFO repository/server.go:37 [1.8835ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:20:25.726] INFO repository/system.go:28 [523.6µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 15:20:36.143] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 15:20:36.156] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:36.156] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 15:20:36.156] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:36.156] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:20:36.158] INFO sqlite@v1.5.5/migrator.go:413 [998.1µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:20:36.158] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:20:36.158] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:20:36.159] INFO sqlite@v1.5.5/migrator.go:423 [1.0002ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:20:36.162] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:36.162] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:20:36.163] INFO sqlite@v1.5.5/migrator.go:413 [535.5µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:20:36.163] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:20:36.163] INFO sqlite@v1.5.5/migrator.go:423 [514.5µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:20:36.165] INFO sqlite@v1.5.5/migrator.go:423 [1.0701ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:20:36.166] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 15:20:36.166] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:36.167] INFO sqlite@v1.5.5/migrator.go:125 [64.9µs] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 15:20:36.167] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:36.167] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 15:20:36.168] INFO sqlite@v1.5.5/migrator.go:413 [606.4µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 15:20:36.168] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 15:20:36.168] INFO sqlite@v1.5.5/migrator.go:423 [503.5µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 15:20:36.170] INFO sqlite@v1.5.5/migrator.go:423 [1.7259ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 15:20:36.172] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 15:20:36.172] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:36.172] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 15:20:36.172] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:36.173] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:20:36.174] INFO sqlite@v1.5.5/migrator.go:413 [534.3µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:20:36.175] INFO sqlite@v1.5.5/migrator.go:423 [575.5µs] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:20:36.175] INFO sqlite@v1.5.5/migrator.go:423 [518.3µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:20:36.177] INFO sqlite@v1.5.5/migrator.go:423 [1.661ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:20:36.178] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:20:36.178] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:20:36.180] INFO sqlite@v1.5.5/migrator.go:413 [521.9µs] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:20:36.180] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:20:36.180] INFO sqlite@v1.5.5/migrator.go:423 [558.2µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:20:36.182] INFO sqlite@v1.5.5/migrator.go:423 [1.7029ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:20:36.184] INFO sqlite@v1.5.5/migrator.go:219 [66.1µs] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 15:20:36.184] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 15:20:36.184] INFO sqlite@v1.5.5/migrator.go:32 [522µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 15:20:36.184] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:20:36.184] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 15:20:36.185] INFO script/script.go:61 [503µs] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 15:20:36.185] INFO script/script.go:98 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 15:20:37.209] INFO repository/user.go:44 [407.2µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:20:37.213] INFO repository/server.go:63 [3.927ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:20:37.209" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:20:37.234] INFO callbacks/preload.go:261 [0s] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:20:37.234] INFO callbacks/preload.go:261 [506.6µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:20:37.234] INFO repository/server.go:37 [1.2413ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:20:37.234] INFO repository/system.go:28 [0s] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 15:46:46.381] INFO sqlite@v1.5.5/migrator.go:32 [999.9µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 15:46:46.393] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:46:46.394] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 15:46:46.394] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:46:46.394] INFO sqlite@v1.5.5/migrator.go:368 [519µs] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:46:46.396] INFO sqlite@v1.5.5/migrator.go:413 [1.6379ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:46:46.396] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:46:46.396] INFO sqlite@v1.5.5/migrator.go:423 [514.4µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:46:46.398] INFO sqlite@v1.5.5/migrator.go:423 [1.0595ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:46:46.400] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:46:46.400] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:46:46.401] INFO sqlite@v1.5.5/migrator.go:413 [540.6µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:46:46.401] INFO sqlite@v1.5.5/migrator.go:423 [542.6µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:46:46.402] INFO sqlite@v1.5.5/migrator.go:423 [506µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:46:46.403] INFO sqlite@v1.5.5/migrator.go:423 [1.0853ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:46:46.405] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 15:46:46.405] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:46:46.406] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 15:46:46.406] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:46:46.406] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 15:46:46.407] INFO sqlite@v1.5.5/migrator.go:413 [546.9µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 15:46:46.407] INFO sqlite@v1.5.5/migrator.go:423 [519.9µs] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 15:46:46.408] INFO sqlite@v1.5.5/migrator.go:423 [552.1µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 15:46:46.409] INFO sqlite@v1.5.5/migrator.go:423 [1.6173ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 15:46:46.411] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 15:46:46.412] INFO migrator/migrator.go:73 [531.8µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:46:46.412] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 15:46:46.412] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:46:46.412] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:46:46.413] INFO sqlite@v1.5.5/migrator.go:413 [525.2µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:46:46.414] INFO sqlite@v1.5.5/migrator.go:423 [553.8µs] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:46:46.414] INFO sqlite@v1.5.5/migrator.go:423 [543.7µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:46:46.416] INFO sqlite@v1.5.5/migrator.go:423 [1.62ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:46:46.418] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:46:46.418] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:46:46.419] INFO sqlite@v1.5.5/migrator.go:413 [545.8µs] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:46:46.419] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:46:46.420] INFO sqlite@v1.5.5/migrator.go:423 [549.6µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:46:46.421] INFO sqlite@v1.5.5/migrator.go:423 [1.073ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:46:46.422] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 15:46:46.423] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 15:46:46.423] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 15:46:46.423] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:46:46.423] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 15:46:46.423] INFO script/script.go:61 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 15:46:46.425] INFO script/script.go:98 [63.1µs] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 15:47:09.168] INFO repository/user.go:44 [637µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:47:09.171] INFO repository/server.go:63 [3.1582ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:47:09.168" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:47:09.191] INFO callbacks/preload.go:261 [0s] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:47:09.191] INFO callbacks/preload.go:261 [504µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:47:09.191] INFO repository/server.go:37 [1.2724ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:47:09.192] INFO repository/system.go:28 [521.4µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 15:47:54.814] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 15:47:54.827] INFO migrator/migrator.go:73 [52.9µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:47:54.827] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 15:47:54.827] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:47:54.827] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:47:54.828] INFO sqlite@v1.5.5/migrator.go:413 [578.5µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:47:54.829] INFO sqlite@v1.5.5/migrator.go:423 [521.2µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:47:54.829] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:47:54.830] INFO sqlite@v1.5.5/migrator.go:423 [644.3µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:47:54.832] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:47:54.832] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:47:54.833] INFO sqlite@v1.5.5/migrator.go:413 [565.5µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:47:54.833] INFO sqlite@v1.5.5/migrator.go:423 [537.7µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:47:54.833] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:47:54.835] INFO sqlite@v1.5.5/migrator.go:423 [1.133ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:47:54.836] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 15:47:54.837] INFO migrator/migrator.go:73 [73µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:47:54.837] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 15:47:54.838] INFO sqlite@v1.5.5/migrator.go:79 [57.1µs] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:47:54.838] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 15:47:54.839] INFO sqlite@v1.5.5/migrator.go:413 [553µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 15:47:54.839] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 15:47:54.839] INFO sqlite@v1.5.5/migrator.go:423 [570.1µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 15:47:54.841] INFO sqlite@v1.5.5/migrator.go:423 [1.7912ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 15:47:54.842] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 15:47:54.843] INFO migrator/migrator.go:73 [551.5µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:47:54.843] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 15:47:54.843] INFO sqlite@v1.5.5/migrator.go:79 [61µs] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:47:54.843] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:47:54.844] INFO sqlite@v1.5.5/migrator.go:413 [598µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:47:54.844] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:47:54.845] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:47:54.847] INFO sqlite@v1.5.5/migrator.go:423 [1.7086ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:47:54.848] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:47:54.848] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:47:54.850] INFO sqlite@v1.5.5/migrator.go:413 [591µs] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:47:54.851] INFO sqlite@v1.5.5/migrator.go:423 [521.8µs] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:47:54.851] INFO sqlite@v1.5.5/migrator.go:423 [551.7µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:47:54.852] INFO sqlite@v1.5.5/migrator.go:423 [1.1661ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:47:54.853] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 15:47:54.853] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 15:47:54.855] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 15:47:54.855] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:47:54.855] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 15:47:54.855] INFO script/script.go:61 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 15:47:54.855] INFO script/script.go:98 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 15:47:57.696] INFO repository/user.go:44 [987.3µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:47:57.698] INFO repository/server.go:63 [2.1737ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:47:57.696" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:47:57.718] INFO callbacks/preload.go:261 [505.4µs] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:47:57.718] INFO callbacks/preload.go:261 [505.4µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:47:57.718] INFO repository/server.go:37 [1.3592ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:47:57.718] INFO repository/system.go:28 [530.1µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 15:48:11.267] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 15:48:11.280] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:48:11.281] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 15:48:11.281] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:48:11.281] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:48:11.282] INFO sqlite@v1.5.5/migrator.go:413 [645.4µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:48:11.283] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:48:11.284] INFO sqlite@v1.5.5/migrator.go:423 [540.4µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:48:11.284] INFO sqlite@v1.5.5/migrator.go:423 [723.3µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:48:11.286] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:48:11.287] INFO sqlite@v1.5.5/migrator.go:368 [502.6µs] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:48:11.287] INFO sqlite@v1.5.5/migrator.go:413 [611.7µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:48:11.288] INFO sqlite@v1.5.5/migrator.go:423 [54.9µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:48:11.288] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:48:11.290] INFO sqlite@v1.5.5/migrator.go:423 [1.144ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:48:11.292] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 15:48:11.292] INFO migrator/migrator.go:73 [54.4µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:48:11.292] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 15:48:11.293] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:48:11.293] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 15:48:11.294] INFO sqlite@v1.5.5/migrator.go:413 [564.7µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 15:48:11.294] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 15:48:11.294] INFO sqlite@v1.5.5/migrator.go:423 [621.1µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 15:48:11.296] INFO sqlite@v1.5.5/migrator.go:423 [1.1748ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 15:48:11.297] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 15:48:11.297] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:48:11.298] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 15:48:11.298] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:48:11.298] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:48:11.299] INFO sqlite@v1.5.5/migrator.go:413 [587.1µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:48:11.300] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:48:11.300] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:48:11.301] INFO sqlite@v1.5.5/migrator.go:423 [618.5µs] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:48:11.302] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:48:11.302] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:48:11.303] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:48:11.303] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:48:11.305] INFO sqlite@v1.5.5/migrator.go:423 [1.6006ms] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:48:11.306] INFO sqlite@v1.5.5/migrator.go:423 [1.0708ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:48:11.308] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 15:48:11.309] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 15:48:11.309] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 15:48:11.309] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:48:11.309] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 15:48:11.309] INFO script/script.go:61 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 15:48:11.309] INFO script/script.go:98 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 15:48:13.325] INFO repository/user.go:44 [902.5µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:48:13.327] INFO repository/server.go:63 [2.1308ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:48:13.325" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:48:13.347] INFO callbacks/preload.go:261 [503.6µs] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:48:13.347] INFO callbacks/preload.go:261 [503.6µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:48:13.347] INFO repository/server.go:37 [813.6µs] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:48:13.348] INFO repository/system.go:28 [522.8µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 15:49:12.581] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-11 15:49:12.594] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:49:12.595] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-11 15:49:12.595] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:49:12.595] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:49:12.596] INFO sqlite@v1.5.5/migrator.go:413 [1.0446ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:49:12.597] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:49:12.597] INFO sqlite@v1.5.5/migrator.go:423 [572.6µs] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:49:12.598] INFO sqlite@v1.5.5/migrator.go:423 [1.1013ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:49:12.600] INFO sqlite@v1.5.5/migrator.go:79 [76.8µs] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:49:12.600] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-11 15:49:12.601] INFO sqlite@v1.5.5/migrator.go:413 [523.1µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-11 15:49:12.601] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-11 15:49:12.602] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-11 15:49:12.603] INFO sqlite@v1.5.5/migrator.go:423 [1.0366ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-11 15:49:12.604] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-11 15:49:12.605] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:49:12.605] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-11 15:49:12.605] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:49:12.605] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-11 15:49:12.606] INFO sqlite@v1.5.5/migrator.go:413 [545.2µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-11 15:49:12.606] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-11 15:49:12.607] INFO sqlite@v1.5.5/migrator.go:423 [538.2µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-11 15:49:12.608] INFO sqlite@v1.5.5/migrator.go:423 [1.0377ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-11 15:49:12.610] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-11 15:49:12.610] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:49:12.610] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-11 15:49:12.610] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:49:12.611] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:49:12.612] INFO sqlite@v1.5.5/migrator.go:413 [518.6µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:49:12.612] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:49:12.612] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:49:12.614] INFO sqlite@v1.5.5/migrator.go:423 [1.5882ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:49:12.615] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-11 15:49:12.615] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-11 15:49:12.616] INFO sqlite@v1.5.5/migrator.go:413 [530.6µs] [rows:2] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` varchar(36) NOT NULL,`enabled` tinyint(1),PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`),CONSTRAINT `fk_t_wg_client_user` FOREIGN KEY (`user_id`) REFERENCES `t_user`(`id`))
[2024-03-11 15:49:12.617] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:2] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`,`enabled` FROM `t_wg_client`
[2024-03-11 15:49:12.617] INFO sqlite@v1.5.5/migrator.go:423 [528.2µs] [rows:2] DROP TABLE `t_wg_client`
[2024-03-11 15:49:12.619] INFO sqlite@v1.5.5/migrator.go:423 [1.0588ms] [rows:2] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-11 15:49:12.620] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_client_user"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %" OR sql LIKE "%CONSTRAINT `fk_t_wg_client_user`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_client_user]%" OR sql LIKE "%CONSTRAINT fk_t_wg_client_user %")
[2024-03-11 15:49:12.620] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-11 15:49:12.621] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-11 15:49:12.621] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-11 15:49:12.621] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-11 15:49:12.621] INFO script/script.go:61 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-11 15:49:12.621] INFO script/script.go:98 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-11 15:49:19.295] INFO repository/user.go:44 [122.1µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:49:19.297] INFO repository/server.go:63 [2.1076ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:49:19.295" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:49:19.317] INFO callbacks/preload.go:261 [506.7µs] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:49:19.317] INFO callbacks/preload.go:261 [506.7µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:49:19.317] INFO repository/server.go:37 [1.5703ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:49:19.318] INFO repository/system.go:28 [575µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-11 15:49:23.748] INFO repository/user.go:44 [216.2µs] [rows:1] SELECT * FROM `t_user` WHERE id = "0dbdde3660934396b79a6bad002d82a8" ORDER BY `t_user`.`id` LIMIT 1
[2024-03-11 15:49:23.751] INFO repository/server.go:63 [2.3822ms] [rows:1] UPDATE `t_wg_server` SET `ip_scope`="10.10.10.1/32",`listen_port`=51820,`post_down_script`="",`post_up_script`="",`pre_down_script`="",`updated_at`="2024-03-11 15:49:23.749" WHERE id = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:49:23.769] INFO callbacks/preload.go:261 [0s] [rows:1] SELECT * FROM `t_user` WHERE `t_user`.`id` = "0dbdde3660934396b79a6bad002d82a8"
[2024-03-11 15:49:23.770] INFO callbacks/preload.go:261 [558.8µs] [rows:2] SELECT * FROM `t_wg_client` WHERE `t_wg_client`.`server_id` = "2cc89e0b665c47b683a4042b8654062a"
[2024-03-11 15:49:23.770] INFO repository/server.go:37 [1.5213ms] [rows:1] SELECT * FROM `t_wg_server` WHERE id = "2cc89e0b665c47b683a4042b8654062a" ORDER BY `t_wg_server`.`id` LIMIT 1
[2024-03-11 15:49:23.770] INFO repository/system.go:28 [503.7µs] [rows:1] SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1

View File

@ -14,6 +14,11 @@ func Avatar() avatar {
return avatar{}
}
// GenerateAvatar
// @description: 生成随机头像 - 默认头像
// @receiver avatar
// @return path
// @return err
func (avatar) GenerateAvatar() (path string, err error) {
rand.New(rand.NewSource(time.Now().UnixNano()))
r := client.HttpClient.R()