From 00ec03909504fbef30915e13fabfb1eeb6856a4e Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Tue, 19 Aug 2025 12:38:22 +0800 Subject: [PATCH] Add test data SQL script for config plugin (#776) --- backend/plugin/config/sql/mysql/init.sql | 8 ++++++++ backend/plugin/config/sql/mysql/init_snowflake.sql | 8 ++++++++ backend/plugin/config/sql/postgresql/init.sql | 11 +++++++++++ .../plugin/config/sql/postgresql/init_snowflake.sql | 8 ++++++++ 4 files changed, 35 insertions(+) create mode 100644 backend/plugin/config/sql/mysql/init.sql create mode 100644 backend/plugin/config/sql/mysql/init_snowflake.sql create mode 100644 backend/plugin/config/sql/postgresql/init.sql create mode 100644 backend/plugin/config/sql/postgresql/init_snowflake.sql diff --git a/backend/plugin/config/sql/mysql/init.sql b/backend/plugin/config/sql/mysql/init.sql new file mode 100644 index 00000000..553a9ea1 --- /dev/null +++ b/backend/plugin/config/sql/mysql/init.sql @@ -0,0 +1,8 @@ +insert into sys_config (id, name, type, key, value, is_frontend, remark, created_time, updated_time) +values +(1, '状态', 'EMAIL', 'EMAIL_STATUS', '1', 0, null, '2025-08-17 23:08:44', '2025-08-19 10:53:24'), +(2, '服务器地址', 'EMAIL', 'EMAIL_HOST', 'smtp.qq.com', 0, null, '2025-08-17 23:08:57', '2025-08-19 10:53:24'), +(3, '服务器端口', 'EMAIL', 'EMAIL_PORT', '465', 0, null, '2025-08-17 23:10:53', '2025-08-19 10:53:24'), +(4, '邮箱账号', 'EMAIL', 'EMAIL_USERNAME', 'fba@qq.com', 0, null, '2025-08-17 23:11:47', '2025-08-19 10:53:24'), +(5, '邮箱密码', 'EMAIL', 'EMAIL_PASSWORD', '', 0, null, '2025-08-17 23:12:09', '2025-08-19 10:53:24'), +(6, 'SSL 加密', 'EMAIL', 'EMAIL_SSL', '1', 0, null, '2025-08-17 23:52:46', '2025-08-19 10:53:24'); diff --git a/backend/plugin/config/sql/mysql/init_snowflake.sql b/backend/plugin/config/sql/mysql/init_snowflake.sql new file mode 100644 index 00000000..a7251e5d --- /dev/null +++ b/backend/plugin/config/sql/mysql/init_snowflake.sql @@ -0,0 +1,8 @@ +insert into sys_config (id, name, type, key, value, is_frontend, remark, created_time, updated_time) +values +(2069061886627938304, '状态', 'EMAIL', 'EMAIL_STATUS', '1', 0, null, '2025-08-17 23:08:44', '2025-08-19 10:53:24'), +(2069061886627938305, '服务器地址', 'EMAIL', 'EMAIL_HOST', 'smtp.qq.com', 0, null, '2025-08-17 23:08:57', '2025-08-19 10:53:24'), +(2069061886627938306, '服务器端口', 'EMAIL', 'EMAIL_PORT', '465', 0, null, '2025-08-17 23:10:53', '2025-08-19 10:53:24'), +(2069061886627938307, '邮箱账号', 'EMAIL', 'EMAIL_USERNAME', 'fba@qq.com', 0, null, '2025-08-17 23:11:47', '2025-08-19 10:53:24'), +(2069061886627938308, '邮箱密码', 'EMAIL', 'EMAIL_PASSWORD', '', 0, null, '2025-08-17 23:12:09', '2025-08-19 10:53:24'), +(2069061886627938309, 'SSL 加密', 'EMAIL', 'EMAIL_SSL', '1', 0, null, '2025-08-17 23:52:46', '2025-08-19 10:53:24'); diff --git a/backend/plugin/config/sql/postgresql/init.sql b/backend/plugin/config/sql/postgresql/init.sql new file mode 100644 index 00000000..eae239dd --- /dev/null +++ b/backend/plugin/config/sql/postgresql/init.sql @@ -0,0 +1,11 @@ +insert into sys_config (id, name, type, key, value, is_frontend, remark, created_time, updated_time) +values +(1, '状态', 'EMAIL', 'EMAIL_STATUS', '1', 0, null, '2025-08-17 23:08:44', '2025-08-19 10:53:24'), +(2, '服务器地址', 'EMAIL', 'EMAIL_HOST', 'smtp.qq.com', 0, null, '2025-08-17 23:08:57', '2025-08-19 10:53:24'), +(3, '服务器端口', 'EMAIL', 'EMAIL_PORT', '465', 0, null, '2025-08-17 23:10:53', '2025-08-19 10:53:24'), +(4, '邮箱账号', 'EMAIL', 'EMAIL_USERNAME', 'fba@qq.com', 0, null, '2025-08-17 23:11:47', '2025-08-19 10:53:24'), +(5, '邮箱密码', 'EMAIL', 'EMAIL_PASSWORD', '', 0, null, '2025-08-17 23:12:09', '2025-08-19 10:53:24'), +(6, 'SSL 加密', 'EMAIL', 'EMAIL_SSL', '1', 0, null, '2025-08-17 23:52:46', '2025-08-19 10:53:24'); + +-- reset auto-increment values for each table based on max id +select setval(pg_get_serial_sequence('sys_config', 'id'),coalesce(max(id), 0) + 1, true) from sys_config; diff --git a/backend/plugin/config/sql/postgresql/init_snowflake.sql b/backend/plugin/config/sql/postgresql/init_snowflake.sql new file mode 100644 index 00000000..a7251e5d --- /dev/null +++ b/backend/plugin/config/sql/postgresql/init_snowflake.sql @@ -0,0 +1,8 @@ +insert into sys_config (id, name, type, key, value, is_frontend, remark, created_time, updated_time) +values +(2069061886627938304, '状态', 'EMAIL', 'EMAIL_STATUS', '1', 0, null, '2025-08-17 23:08:44', '2025-08-19 10:53:24'), +(2069061886627938305, '服务器地址', 'EMAIL', 'EMAIL_HOST', 'smtp.qq.com', 0, null, '2025-08-17 23:08:57', '2025-08-19 10:53:24'), +(2069061886627938306, '服务器端口', 'EMAIL', 'EMAIL_PORT', '465', 0, null, '2025-08-17 23:10:53', '2025-08-19 10:53:24'), +(2069061886627938307, '邮箱账号', 'EMAIL', 'EMAIL_USERNAME', 'fba@qq.com', 0, null, '2025-08-17 23:11:47', '2025-08-19 10:53:24'), +(2069061886627938308, '邮箱密码', 'EMAIL', 'EMAIL_PASSWORD', '', 0, null, '2025-08-17 23:12:09', '2025-08-19 10:53:24'), +(2069061886627938309, 'SSL 加密', 'EMAIL', 'EMAIL_SSL', '1', 0, null, '2025-08-17 23:52:46', '2025-08-19 10:53:24');