update 优化sql 创建表之前如果存在旧表,则先将旧表删除

This commit is contained in:
Liang 2024-04-01 17:48:53 +08:00
parent 089b089fce
commit 5199a53f7d
3 changed files with 11 additions and 1 deletions

View File

@ -98,6 +98,7 @@ create table wf_definition_config
) )
comment '流程定义配置'; comment '流程定义配置';
DROP TABLE if EXISTS wf_form_manage;
create table wf_form_manage create table wf_form_manage
( (
id bigint not null comment '主键' id bigint not null comment '主键'
@ -117,7 +118,8 @@ create table wf_form_manage
insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, sysdate(), 1, sysdate()); insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, sysdate(), 1, sysdate());
create table wf_node_config DROP TABLE if EXISTS wf_form_manage;
create table wf_form_manage
( (
id bigint not null comment '主键' id bigint not null comment '主键'
primary key, primary key,

View File

@ -116,6 +116,7 @@ create unique index uni_category_code
INSERT INTO wf_category values (1, 'OA', 'OA', 0, 0, '000000', 103, 1, now(), 1, now()); INSERT INTO wf_category values (1, 'OA', 'OA', 0, 0, '000000', 103, 1, now(), 1, now());
DROP TABLE if EXISTS wf_task_back_node;
create table wf_task_back_node create table wf_task_back_node
( (
id bigint not null id bigint not null
@ -166,6 +167,7 @@ comment on column wf_task_back_node.update_time is '修改时间';
alter table wf_task_back_node alter table wf_task_back_node
owner to postgres; owner to postgres;
DROP TABLE if EXISTS wf_definition_config;
create table wf_definition_config create table wf_definition_config
( (
id bigint not null id bigint not null
@ -209,6 +211,7 @@ alter table wf_definition_config
create unique index uni_definition_id create unique index uni_definition_id
on wf_definition_config (definition_id); on wf_definition_config (definition_id);
DROP TABLE if EXISTS wf_form_manage;
create table wf_form_manage create table wf_form_manage
( (
id bigint not null id bigint not null
@ -252,6 +255,7 @@ comment on column wf_form_manage.update_time is '修改时间';
insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, now(), 1, now()); insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, now(), 1, now());
DROP TABLE if EXISTS wf_node_config;
create table wf_node_config create table wf_node_config
( (
id bigint not null id bigint not null

View File

@ -148,6 +148,7 @@ go
INSERT INTO wf_category values (1, 'OA', 'OA', 0, 0, '000000', 103, 1, getdate(), 1, getdate()); INSERT INTO wf_category values (1, 'OA', 'OA', 0, 0, '000000', 103, 1, getdate(), 1, getdate());
DROP TABLE if EXISTS wf_task_back_node;
create table wf_task_back_node create table wf_task_back_node
( (
id bigint not null primary key, id bigint not null primary key,
@ -214,6 +215,7 @@ exec sp_addextendedproperty 'MS_Description', N'更新时间', 'SCHEMA', 'dbo',
'update_time' 'update_time'
go go
DROP TABLE if EXISTS wf_definition_config;
create table wf_definition_config create table wf_definition_config
( (
id bigint not null primary key, id bigint not null primary key,
@ -271,6 +273,7 @@ exec sp_addextendedproperty 'MS_Description', N'更新时间', 'SCHEMA', 'dbo',
'update_time' 'update_time'
go go
DROP TABLE if EXISTS wf_form_manage;
create table wf_form_manage create table wf_form_manage
( (
id bigint not null primary key, id bigint not null primary key,
@ -333,6 +336,7 @@ go
insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, getdate(), 1, getdate()); insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, getdate(), 1, getdate());
DROP TABLE if EXISTS wf_node_config;
create table wf_node_config create table wf_node_config
( (
id bigint not null primary key, id bigint not null primary key,