From 8c53700cfd8ea20ccece1867161d2315d5346d9b Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 30 Dec 2024 20:38:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20PostgreSQL=20Liquib?= =?UTF-8?q?ase=20=E6=95=B0=E6=8D=AE=E8=84=9A=E6=9C=AC=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #118 Closes #119 --- .../db/changelog/mysql/main_table.sql | 26 +++++++++---------- .../db/changelog/postgresql/main_data.sql | 6 +++++ .../db/changelog/postgresql/main_table.sql | 4 +++ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/continew-webapi/src/main/resources/db/changelog/mysql/main_table.sql b/continew-webapi/src/main/resources/db/changelog/mysql/main_table.sql index f0f9b1a9..d76c5be3 100644 --- a/continew-webapi/src/main/resources/db/changelog/mysql/main_table.sql +++ b/continew-webapi/src/main/resources/db/changelog/mysql/main_table.sql @@ -232,19 +232,19 @@ CREATE TABLE IF NOT EXISTS `sys_message_user` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息和用户关联表'; CREATE TABLE IF NOT EXISTS `sys_notice` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `title` varchar(150) NOT NULL COMMENT '标题', - `content` mediumtext NOT NULL COMMENT '内容', - `type` varchar(30) NOT NULL COMMENT '类型', - `effective_time` datetime DEFAULT NULL COMMENT '生效时间', - `terminate_time` datetime DEFAULT NULL COMMENT '终止时间', - `notice_scope` int NOT NULL COMMENT '通知范围', - `notice_users` json DEFAULT NULL COMMENT '通知用户', - `sort` int NOT NULL DEFAULT 999 COMMENT '排序', - `create_user` bigint(20) NOT NULL COMMENT '创建人', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', - `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `title` varchar(150) NOT NULL COMMENT '标题', + `content` mediumtext NOT NULL COMMENT '内容', + `type` varchar(30) NOT NULL COMMENT '类型', + `effective_time` datetime DEFAULT NULL COMMENT '生效时间', + `terminate_time` datetime DEFAULT NULL COMMENT '终止时间', + `notice_scope` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '通知范围(1:所有人;2:指定用户)', + `notice_users` json DEFAULT NULL COMMENT '通知用户', + `sort` int NOT NULL DEFAULT 999 COMMENT '排序', + `create_user` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`), INDEX `idx_create_user`(`create_user`), INDEX `idx_update_user`(`update_user`) diff --git a/continew-webapi/src/main/resources/db/changelog/postgresql/main_data.sql b/continew-webapi/src/main/resources/db/changelog/postgresql/main_data.sql index c8ca3609..b2e93efb 100644 --- a/continew-webapi/src/main/resources/db/changelog/postgresql/main_data.sql +++ b/continew-webapi/src/main/resources/db/changelog/postgresql/main_data.sql @@ -198,3 +198,9 @@ INSERT INTO "sys_storage" VALUES (1, '开发环境', 'local_dev', 2, NULL, NULL, NULL, 'C:/continew-admin/data/file/', 'http://localhost:8000/file', '本地存储', true, 1, 1, 1, NOW()), (2, '生产环境', 'local_prod', 2, NULL, NULL, NULL, '../data/file/', 'http://api.continew.top/file', '本地存储', false, 2, 2, 1, NOW()); + +-- 初始化客户端数据 +INSERT INTO "sys_client" +("id", "client_id", "client_key", "client_secret", "auth_type", "client_type", "active_timeout", "timeout", "status", "create_user", "create_time") +VALUES +(1, 'ef51c9a3e9046c4f2ea45142c8a8344a', 'pc', 'dd77ab1e353a027e0d60ce3b151e8642', '[\"ACCOUNT\", \"EMAIL\", \"PHONE\", \"SOCIAL\"]', 'PC', 1800, 86400, 1, 1, NOW()); diff --git a/continew-webapi/src/main/resources/db/changelog/postgresql/main_table.sql b/continew-webapi/src/main/resources/db/changelog/postgresql/main_table.sql index 868be1ac..7bb274d2 100644 --- a/continew-webapi/src/main/resources/db/changelog/postgresql/main_table.sql +++ b/continew-webapi/src/main/resources/db/changelog/postgresql/main_table.sql @@ -391,6 +391,8 @@ CREATE TABLE IF NOT EXISTS "sys_notice" ( "type" varchar(30) NOT NULL, "effective_time" timestamp DEFAULT NULL, "terminate_time" timestamp DEFAULT NULL, + "notice_scope" int2 NOT NULL DEFAULT 1, + "notice_users" json DEFAULT NULL, "sort" int4 NOT NULL DEFAULT 999, "create_user" int8 NOT NULL, "create_time" timestamp NOT NULL, @@ -406,6 +408,8 @@ COMMENT ON COLUMN "sys_notice"."content" IS '内容'; COMMENT ON COLUMN "sys_notice"."type" IS '类型'; COMMENT ON COLUMN "sys_notice"."effective_time" IS '生效时间'; COMMENT ON COLUMN "sys_notice"."terminate_time" IS '终止时间'; +COMMENT ON COLUMN "sys_notice"."notice_scope" IS '通知范围(1:所有人;2:指定用户)'; +COMMENT ON COLUMN "sys_notice"."notice_users" IS '通知用户'; COMMENT ON COLUMN "sys_notice"."sort" IS '排序'; COMMENT ON COLUMN "sys_notice"."create_user" IS '创建人'; COMMENT ON COLUMN "sys_notice"."create_time" IS '创建时间';