Skip to content

Commit

Permalink
refactor ddl, merge statement
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyan1998 committed Oct 11, 2023
1 parent 8c50ba2 commit 747e0ab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 51 deletions.
10 changes: 3 additions & 7 deletions dinky-admin/src/main/resources/db/db-h2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1343,14 +1343,10 @@ CREATE TABLE `dinky_task` (
`enabled` tinyint(1) NOT null DEFAULT 1 COMMENT 'is enable',
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time',
`version_id` int(11) null DEFAULT null COMMENT 'version id'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_task_statement`;
CREATE TABLE `dinky_task_statement` (
`id` int(11) NOT null COMMENT 'ID',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
`statement` longtext null COMMENT 'statement set'
`version_id` int(11) null DEFAULT null COMMENT 'version id',
`statement` text null DEFAULT null COMMENT 'statement'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `dinky_task_version`;
CREATE TABLE `dinky_task_version` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
Expand Down
21 changes: 1 addition & 20 deletions script/sql/dinky-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -674,31 +674,12 @@ CREATE TABLE `dinky_task` (
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
`version_id` int(11) NULL DEFAULT NULL COMMENT 'version id',
statement text null,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `task_un_idx1`(`name`, `tenant_id`) USING BTREE,
UNIQUE INDEX `task_un_idx2`(`save_point_path`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'Task' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of dinky_task
-- ----------------------------

-- ----------------------------
-- Table structure for dinky_task_statement
-- ----------------------------
DROP TABLE IF EXISTS `dinky_task_statement`;
CREATE TABLE `dinky_task_statement` (
`id` int(11) NOT NULL COMMENT 'ID',
`tenant_id` int(11) NOT NULL DEFAULT 1 COMMENT 'tenant id',
`statement` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'statement set',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `task_statement_un_idx1`(`tenant_id`, `id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'statement' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of dinky_task_statement
-- ----------------------------

-- ----------------------------
-- Table structure for dinky_task_version
-- ----------------------------
Expand Down
27 changes: 3 additions & 24 deletions script/sql/dinky-pg.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,8 @@ CREATE TABLE "public"."dinky_task" (
"enabled" int2 NOT null,
"create_time" timestamp(6),
"update_time" timestamp(6),
"version_id" int4
"version_id" int4,
statement text
)
;
COMMENT ON COLUMN "public"."dinky_task"."id" IS 'ID';
Expand Down Expand Up @@ -1166,31 +1167,9 @@ COMMENT ON COLUMN "public"."dinky_task"."enabled" IS 'is enable';
COMMENT ON COLUMN "public"."dinky_task"."create_time" IS 'create time';
COMMENT ON COLUMN "public"."dinky_task"."update_time" IS 'update time';
COMMENT ON COLUMN "public"."dinky_task"."version_id" IS 'version id';
COMMENT ON COLUMN "public"."dinky_task"."statement" IS 'statement';
COMMENT ON TABLE "public"."dinky_task" IS 'Task';

-- ----------------------------
-- Records of dinky_task
-- ----------------------------

-- ----------------------------
-- Table structure for dinky_task_statement
-- ----------------------------
DROP TABLE IF EXISTS "public"."dinky_task_statement";
CREATE TABLE "public"."dinky_task_statement" (
"id" SERIAL NOT null,
"tenant_id" int4 NOT null,
"statement" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."dinky_task_statement"."id" IS 'ID';
COMMENT ON COLUMN "public"."dinky_task_statement"."tenant_id" IS 'tenant id';
COMMENT ON COLUMN "public"."dinky_task_statement"."statement" IS 'statement set';
COMMENT ON TABLE "public"."dinky_task_statement" IS 'statement';

-- ----------------------------
-- Records of dinky_task_statement
-- ----------------------------

-- ----------------------------
-- Table structure for dinky_task_version
-- ----------------------------
Expand Down
2 changes: 2 additions & 0 deletions script/sql/upgrade/1.0.0-SNAPSHOT_schema/mysql/dinky_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ alter table dinky_user

alter table dinky_user_tenant add tenant_admin_flag tinyint default 0 comment 'tenant admin flag(0:false,1:true)' after tenant_id;

alter table dinky_task
add statement text null;

drop table dinky_namespace;
drop table dinky_role_namespace;
Expand Down

0 comments on commit 747e0ab

Please sign in to comment.