From 7c0f41c785ef1ae7b121cf7c6127e7566da866a5 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 11 三月 2022 13:00:09 +0800
Subject: [PATCH] update 确保更好的适配 多数据库 主键策略统一改为 雪花ID

---
 script/sql/sqlserver/sqlserver_ry_vue_4.X.sql  |   28 ++++----
 script/sql/ry_vue_4.0.sql                      |   80 +++++++++++++-------------
 ruoyi-admin/src/main/resources/application.yml |    8 --
 script/sql/test.sql                            |   40 ++++++------
 4 files changed, 75 insertions(+), 81 deletions(-)

diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index 5641fdb..b445974 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -179,16 +179,10 @@
   global-config:
     # 鏄惁鎵撳嵃 Logo banner
     banner: true
-    # 鏄惁鍒濆鍖� SqlRunner
-    enableSqlRunner: false
     dbConfig:
       # 涓婚敭绫诲瀷
       # AUTO 鑷 NONE 绌� INPUT 鐢ㄦ埛杈撳叆 ASSIGN_ID 闆姳 ASSIGN_UUID 鍞竴 UUID
-      idType: AUTO
-      # 琛ㄥ悕鏄惁浣跨敤椹煎嘲杞笅鍒掔嚎鍛藉悕,鍙琛ㄥ悕鐢熸晥
-      tableUnderline: true
-      # 澶у啓鍛藉悕,瀵硅〃鍚嶅拰瀛楁鍚嶅潎鐢熸晥
-      capitalMode: false
+      idType: ASSIGN_ID
       # 閫昏緫宸插垹闄ゅ��
       logicDeleteValue: 2
       # 閫昏緫鏈垹闄ゅ��
diff --git a/script/sql/ry_vue_4.0.sql b/script/sql/ry_vue_4.0.sql
index 9b57bd0..1fe490e 100644
--- a/script/sql/ry_vue_4.0.sql
+++ b/script/sql/ry_vue_4.0.sql
@@ -3,7 +3,7 @@
 -- ----------------------------
 drop table if exists sys_dept;
 create table sys_dept (
-  dept_id           bigint(20)      not null auto_increment    comment '閮ㄩ棬id',
+  dept_id           bigint(20)      not null     comment '閮ㄩ棬id',
   parent_id         bigint(20)      default 0                  comment '鐖堕儴闂╥d',
   ancestors         varchar(50)     default ''                 comment '绁栫骇鍒楄〃',
   dept_name         varchar(30)     default ''                 comment '閮ㄩ棬鍚嶇О',
@@ -18,7 +18,7 @@
   update_by         varchar(64)     default ''                 comment '鏇存柊鑰�',
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   primary key (dept_id)
-) engine=innodb auto_increment=200 comment = '閮ㄩ棬琛�';
+) engine=innodb comment = '閮ㄩ棬琛�';
 
 -- ----------------------------
 -- 鍒濆鍖�-閮ㄩ棬琛ㄦ暟鎹�
@@ -40,7 +40,7 @@
 -- ----------------------------
 drop table if exists sys_user;
 create table sys_user (
-  user_id           bigint(20)      not null auto_increment    comment '鐢ㄦ埛ID',
+  user_id           bigint(20)      not null     comment '鐢ㄦ埛ID',
   dept_id           bigint(20)      default null               comment '閮ㄩ棬ID',
   user_name         varchar(30)     not null                   comment '鐢ㄦ埛璐﹀彿',
   nick_name         varchar(30)     not null                   comment '鐢ㄦ埛鏄电О',
@@ -60,7 +60,7 @@
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   remark            varchar(500)    default null               comment '澶囨敞',
   primary key (user_id)
-) engine=innodb auto_increment=100 comment = '鐢ㄦ埛淇℃伅琛�';
+) engine=innodb comment = '鐢ㄦ埛淇℃伅琛�';
 
 -- ----------------------------
 -- 鍒濆鍖�-鐢ㄦ埛淇℃伅琛ㄦ暟鎹�
@@ -75,14 +75,14 @@
 drop table if exists sys_post;
 create table sys_post
 (
-  post_id       bigint(20)      not null auto_increment    comment '宀椾綅ID',
+  post_id       bigint(20)      not null                   comment '宀椾綅ID',
   post_code     varchar(64)     not null                   comment '宀椾綅缂栫爜',
   post_name     varchar(50)     not null                   comment '宀椾綅鍚嶇О',
   post_sort     int(4)          not null                   comment '鏄剧ず椤哄簭',
   status        char(1)         not null                   comment '鐘舵�侊紙0姝e父 1鍋滅敤锛�',
   create_by     varchar(64)     default ''                 comment '鍒涘缓鑰�',
   create_time   datetime                                   comment '鍒涘缓鏃堕棿',
-  update_by     varchar(64)     default ''                   comment '鏇存柊鑰�',
+  update_by     varchar(64)     default ''                 comment '鏇存柊鑰�',
   update_time   datetime                                   comment '鏇存柊鏃堕棿',
   remark        varchar(500)    default null               comment '澶囨敞',
   primary key (post_id)
@@ -102,7 +102,7 @@
 -- ----------------------------
 drop table if exists sys_role;
 create table sys_role (
-  role_id              bigint(20)      not null auto_increment    comment '瑙掕壊ID',
+  role_id              bigint(20)      not null                   comment '瑙掕壊ID',
   role_name            varchar(30)     not null                   comment '瑙掕壊鍚嶇О',
   role_key             varchar(100)    not null                   comment '瑙掕壊鏉冮檺瀛楃涓�',
   role_sort            int(4)          not null                   comment '鏄剧ず椤哄簭',
@@ -117,7 +117,7 @@
   update_time          datetime                                   comment '鏇存柊鏃堕棿',
   remark               varchar(500)    default null               comment '澶囨敞',
   primary key (role_id)
-) engine=innodb auto_increment=100 comment = '瑙掕壊淇℃伅琛�';
+) engine=innodb comment = '瑙掕壊淇℃伅琛�';
 
 -- ----------------------------
 -- 鍒濆鍖�-瑙掕壊淇℃伅琛ㄦ暟鎹�
@@ -131,7 +131,7 @@
 -- ----------------------------
 drop table if exists sys_menu;
 create table sys_menu (
-  menu_id           bigint(20)      not null auto_increment    comment '鑿滃崟ID',
+  menu_id           bigint(20)      not null                   comment '鑿滃崟ID',
   menu_name         varchar(50)     not null                   comment '鑿滃崟鍚嶇О',
   parent_id         bigint(20)      default 0                  comment '鐖惰彍鍗旾D',
   order_num         int(4)          default 0                  comment '鏄剧ず椤哄簭',
@@ -151,7 +151,7 @@
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   remark            varchar(500)    default ''                 comment '澶囨敞',
   primary key (menu_id)
-) engine=innodb auto_increment=2000 comment = '鑿滃崟鏉冮檺琛�';
+) engine=innodb comment = '鑿滃崟鏉冮檺琛�';
 
 -- ----------------------------
 -- 鍒濆鍖�-鑿滃崟淇℃伅琛ㄦ暟鎹�
@@ -412,7 +412,7 @@
 -- ----------------------------
 drop table if exists sys_oper_log;
 create table sys_oper_log (
-  oper_id           bigint(20)      not null auto_increment    comment '鏃ュ織涓婚敭',
+  oper_id           bigint(20)      not null                   comment '鏃ュ織涓婚敭',
   title             varchar(50)     default ''                 comment '妯″潡鏍囬',
   business_type     int(2)          default 0                  comment '涓氬姟绫诲瀷锛�0鍏跺畠 1鏂板 2淇敼 3鍒犻櫎锛�',
   method            varchar(100)    default ''                 comment '鏂规硶鍚嶇О',
@@ -429,7 +429,7 @@
   error_msg         varchar(2000)   default ''                 comment '閿欒娑堟伅',
   oper_time         datetime                                   comment '鎿嶄綔鏃堕棿',
   primary key (oper_id)
-) engine=innodb auto_increment=100 comment = '鎿嶄綔鏃ュ織璁板綍';
+) engine=innodb comment = '鎿嶄綔鏃ュ織璁板綍';
 
 
 -- ----------------------------
@@ -438,7 +438,7 @@
 drop table if exists sys_dict_type;
 create table sys_dict_type
 (
-  dict_id          bigint(20)      not null auto_increment    comment '瀛楀吀涓婚敭',
+  dict_id          bigint(20)      not null                   comment '瀛楀吀涓婚敭',
   dict_name        varchar(100)    default ''                 comment '瀛楀吀鍚嶇О',
   dict_type        varchar(100)    default ''                 comment '瀛楀吀绫诲瀷',
   status           char(1)         default '0'                comment '鐘舵�侊紙0姝e父 1鍋滅敤锛�',
@@ -449,7 +449,7 @@
   remark           varchar(500)    default null               comment '澶囨敞',
   primary key (dict_id),
   unique (dict_type)
-) engine=innodb auto_increment=100 comment = '瀛楀吀绫诲瀷琛�';
+) engine=innodb comment = '瀛楀吀绫诲瀷琛�';
 
 insert into sys_dict_type values(1,  '鐢ㄦ埛鎬у埆', 'sys_user_sex',        '0', 'admin', sysdate(), '', null, '鐢ㄦ埛鎬у埆鍒楄〃');
 insert into sys_dict_type values(2,  '鑿滃崟鐘舵��', 'sys_show_hide',       '0', 'admin', sysdate(), '', null, '鑿滃崟鐘舵�佸垪琛�');
@@ -467,7 +467,7 @@
 drop table if exists sys_dict_data;
 create table sys_dict_data
 (
-  dict_code        bigint(20)      not null auto_increment    comment '瀛楀吀缂栫爜',
+  dict_code        bigint(20)      not null                   comment '瀛楀吀缂栫爜',
   dict_sort        int(4)          default 0                  comment '瀛楀吀鎺掑簭',
   dict_label       varchar(100)    default ''                 comment '瀛楀吀鏍囩',
   dict_value       varchar(100)    default ''                 comment '瀛楀吀閿��',
@@ -482,7 +482,7 @@
   update_time      datetime                                   comment '鏇存柊鏃堕棿',
   remark           varchar(500)    default null               comment '澶囨敞',
   primary key (dict_code)
-) engine=innodb auto_increment=100 comment = '瀛楀吀鏁版嵁琛�';
+) engine=innodb comment = '瀛楀吀鏁版嵁琛�';
 
 insert into sys_dict_data values(1,  1,  '鐢�',       '0',       'sys_user_sex',        '',   '',        'Y', '0', 'admin', sysdate(), '', null, '鎬у埆鐢�');
 insert into sys_dict_data values(2,  2,  '濂�',       '1',       'sys_user_sex',        '',   '',        'N', '0', 'admin', sysdate(), '', null, '鎬у埆濂�');
@@ -515,7 +515,7 @@
 -- ----------------------------
 drop table if exists sys_config;
 create table sys_config (
-  config_id         int(5)          not null auto_increment    comment '鍙傛暟涓婚敭',
+  config_id         int(5)          not null                   comment '鍙傛暟涓婚敭',
   config_name       varchar(100)    default ''                 comment '鍙傛暟鍚嶇О',
   config_key        varchar(100)    default ''                 comment '鍙傛暟閿悕',
   config_value      varchar(500)    default ''                 comment '鍙傛暟閿��',
@@ -526,7 +526,7 @@
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   remark            varchar(500)    default null               comment '澶囨敞',
   primary key (config_id)
-) engine=innodb auto_increment=100 comment = '鍙傛暟閰嶇疆琛�';
+) engine=innodb comment = '鍙傛暟閰嶇疆琛�';
 
 insert into sys_config values(1, '涓绘鏋堕〉-榛樿鐨偆鏍峰紡鍚嶇О',     'sys.index.skinName',            'skin-blue',     'Y', 'admin', sysdate(), '', null, '钃濊壊 skin-blue銆佺豢鑹� skin-green銆佺传鑹� skin-purple銆佺孩鑹� skin-red銆侀粍鑹� skin-yellow' );
 insert into sys_config values(2, '鐢ㄦ埛绠$悊-璐﹀彿鍒濆瀵嗙爜',         'sys.user.initPassword',         '123456',        'Y', 'admin', sysdate(), '', null, '鍒濆鍖栧瘑鐮� 123456' );
@@ -541,7 +541,7 @@
 -- ----------------------------
 drop table if exists sys_logininfor;
 create table sys_logininfor (
-  info_id        bigint(20)     not null auto_increment   comment '璁块棶ID',
+  info_id        bigint(20)     not null                  comment '璁块棶ID',
   user_name      varchar(50)    default ''                comment '鐢ㄦ埛璐﹀彿',
   ipaddr         varchar(128)   default ''                comment '鐧诲綍IP鍦板潃',
   login_location varchar(255)   default ''                comment '鐧诲綍鍦扮偣',
@@ -551,7 +551,7 @@
   msg            varchar(255)   default ''                comment '鎻愮ず娑堟伅',
   login_time     datetime                                 comment '璁块棶鏃堕棿',
   primary key (info_id)
-) engine=innodb auto_increment=100 comment = '绯荤粺璁块棶璁板綍';
+) engine=innodb comment = '绯荤粺璁块棶璁板綍';
 
 
 -- ----------------------------
@@ -559,7 +559,7 @@
 -- ----------------------------
 drop table if exists sys_notice;
 create table sys_notice (
-  notice_id         int(4)          not null auto_increment    comment '鍏憡ID',
+  notice_id         int(4)          not null                   comment '鍏憡ID',
   notice_title      varchar(50)     not null                   comment '鍏憡鏍囬',
   notice_type       char(1)         not null                   comment '鍏憡绫诲瀷锛�1閫氱煡 2鍏憡锛�',
   notice_content    longblob        default null               comment '鍏憡鍐呭',
@@ -570,7 +570,7 @@
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   remark            varchar(255)    default null               comment '澶囨敞',
   primary key (notice_id)
-) engine=innodb auto_increment=10 comment = '閫氱煡鍏憡琛�';
+) engine=innodb comment = '閫氱煡鍏憡琛�';
 
 -- ----------------------------
 -- 鍒濆鍖�-鍏憡淇℃伅琛ㄦ暟鎹�
@@ -584,7 +584,7 @@
 -- ----------------------------
 drop table if exists gen_table;
 create table gen_table (
-  table_id          bigint(20)      not null auto_increment    comment '缂栧彿',
+  table_id          bigint(20)      not null                   comment '缂栧彿',
   table_name        varchar(200)    default ''                 comment '琛ㄥ悕绉�',
   table_comment     varchar(500)    default ''                 comment '琛ㄦ弿杩�',
   sub_table_name    varchar(64)     default null               comment '鍏宠仈瀛愯〃鐨勮〃鍚�',
@@ -605,7 +605,7 @@
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   remark            varchar(500)    default null               comment '澶囨敞',
   primary key (table_id)
-) engine=innodb auto_increment=1 comment = '浠g爜鐢熸垚涓氬姟琛�';
+) engine=innodb comment = '浠g爜鐢熸垚涓氬姟琛�';
 
 
 -- ----------------------------
@@ -613,7 +613,7 @@
 -- ----------------------------
 drop table if exists gen_table_column;
 create table gen_table_column (
-  column_id         bigint(20)      not null auto_increment    comment '缂栧彿',
+  column_id         bigint(20)      not null                   comment '缂栧彿',
   table_id          varchar(64)                                comment '褰掑睘琛ㄧ紪鍙�',
   column_name       varchar(200)                               comment '鍒楀悕绉�',
   column_comment    varchar(500)                               comment '鍒楁弿杩�',
@@ -636,18 +636,18 @@
   update_by         varchar(64)     default ''                 comment '鏇存柊鑰�',
   update_time       datetime                                   comment '鏇存柊鏃堕棿',
   primary key (column_id)
-) engine=innodb auto_increment=1 comment = '浠g爜鐢熸垚涓氬姟琛ㄥ瓧娈�';
+) engine=innodb comment = '浠g爜鐢熸垚涓氬姟琛ㄥ瓧娈�';
 
 -- ----------------------------
 -- OSS瀵硅薄瀛樺偍琛�
 -- ----------------------------
 drop table if exists sys_oss;
 create table sys_oss (
-  oss_id          bigint(20)   not null auto_increment    comment '瀵硅薄瀛樺偍涓婚敭',
+  oss_id          bigint(20)   not null                   comment '瀵硅薄瀛樺偍涓婚敭',
   file_name       varchar(255) not null default ''        comment '鏂囦欢鍚�',
   original_name   varchar(255) not null default ''        comment '鍘熷悕',
   file_suffix     varchar(10)  not null default ''        comment '鏂囦欢鍚庣紑鍚�',
-  url              varchar(500) not null                   comment 'URL鍦板潃',
+  url             varchar(500) not null                   comment 'URL鍦板潃',
   create_time     datetime              default null      comment '鍒涘缓鏃堕棿',
   create_by       varchar(64)           default ''        comment '涓婁紶浜�',
   update_time     datetime              default null      comment '鏇存柊鏃堕棿',
@@ -661,19 +661,19 @@
 -- ----------------------------
 drop table if exists sys_oss_config;
 create table sys_oss_config (
-  oss_config_id   bigint(20)   not null auto_increment comment '涓诲缓',
-  config_key      varchar(255)  not null default ''     comment '閰嶇疆key',
-  access_key      varchar(255)            default ''    comment 'accessKey',
-  secret_key      varchar(255)            default ''    comment '绉橀挜',
-  bucket_name     varchar(255)            default ''    comment '妗跺悕绉�',
-  prefix           varchar(255)           default ''     comment '鍓嶇紑',
-  endpoint         varchar(255)           default ''     comment '璁块棶绔欑偣',
-  is_https         char(1)                default 'N'    comment '鏄惁https锛圷=鏄�,N=鍚︼級',
-  region           varchar(255)           default ''     comment '鍩�',
-  status           char(1)                default '1'    comment '鐘舵�侊紙0=姝e父,1=鍋滅敤锛�',
+  oss_config_id   bigint(20)   not null                   comment '涓诲缓',
+  config_key      varchar(255)  not null default ''       comment '閰嶇疆key',
+  access_key      varchar(255)            default ''      comment 'accessKey',
+  secret_key      varchar(255)            default ''      comment '绉橀挜',
+  bucket_name     varchar(255)            default ''      comment '妗跺悕绉�',
+  prefix           varchar(255)           default ''      comment '鍓嶇紑',
+  endpoint         varchar(255)           default ''      comment '璁块棶绔欑偣',
+  is_https         char(1)                default 'N'     comment '鏄惁https锛圷=鏄�,N=鍚︼級',
+  region           varchar(255)           default ''      comment '鍩�',
+  status           char(1)                default '1'     comment '鐘舵�侊紙0=姝e父,1=鍋滅敤锛�',
   ext1             varchar(255)           default ''      comment '鎵╁睍瀛楁',
-  create_by       varchar(64)             default ''     comment '鍒涘缓鑰�',
-  create_time     datetime                default null   comment '鍒涘缓鏃堕棿',
+  create_by       varchar(64)             default ''      comment '鍒涘缓鑰�',
+  create_time     datetime                default null    comment '鍒涘缓鏃堕棿',
   update_by       varchar(64)             default ''      comment '鏇存柊鑰�',
   update_time     datetime                default null    comment '鏇存柊鏃堕棿',
   remark           varchar(500)           default null    comment '澶囨敞',
diff --git a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql
index 29318b9..49d5af9 100644
--- a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql
+++ b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql
@@ -1,7 +1,7 @@
 
 CREATE TABLE [gen_table]
 (
-    [table_id]          bigint IDENTITY (1,1)          NOT NULL,
+    [table_id]          bigint                         NOT NULL,
     [table_name]        nvarchar(200) DEFAULT ''       NULL,
     [table_comment]     nvarchar(500) DEFAULT ''       NULL,
     [sub_table_name]    nvarchar(64)                   NULL,
@@ -156,7 +156,7 @@
 
 CREATE TABLE [gen_table_column]
 (
-    [column_id]      bigint IDENTITY (1,1)        NOT NULL,
+    [column_id]      bigint                       NOT NULL,
     [table_id]       nvarchar(64)                 NULL,
     [column_name]    nvarchar(200)                NULL,
     [column_comment] nvarchar(500)                NULL,
@@ -427,7 +427,7 @@
 
 CREATE TABLE [sys_dept]
 (
-    [dept_id]     bigint IDENTITY (100,1)    NOT NULL,
+    [dept_id]     bigint                     NOT NULL,
     [parent_id]   bigint       DEFAULT ((0)) NULL,
     [ancestors]   nvarchar(50) DEFAULT ''    NULL,
     [dept_name]   nvarchar(30) DEFAULT ''    NULL,
@@ -565,7 +565,7 @@
 
 CREATE TABLE [sys_dict_data]
 (
-    [dict_code]   bigint IDENTITY (1,1)       NOT NULL,
+    [dict_code]   bigint                      NOT NULL,
     [dict_sort]   int           DEFAULT ((0)) NULL,
     [dict_label]  nvarchar(100) DEFAULT ''    NULL,
     [dict_value]  nvarchar(100) DEFAULT ''    NULL,
@@ -739,7 +739,7 @@
 
 CREATE TABLE [sys_dict_type]
 (
-    [dict_id]     bigint IDENTITY (1,1)       NOT NULL,
+    [dict_id]     bigint                      NOT NULL,
     [dict_name]   nvarchar(100) DEFAULT ''    NULL,
     [dict_type]   nvarchar(100) DEFAULT ''    NULL,
     [status]      nchar(1)      DEFAULT ('0') NULL,
@@ -842,7 +842,7 @@
 
 CREATE TABLE [sys_logininfor]
 (
-    [info_id]        bigint IDENTITY (1,1)       NOT NULL,
+    [info_id]        bigint                      NOT NULL,
     [user_name]      nvarchar(50)  DEFAULT ''    NULL,
     [ipaddr]         nvarchar(128) DEFAULT ''    NULL,
     [login_location] nvarchar(255) DEFAULT ''    NULL,
@@ -920,7 +920,7 @@
 
 CREATE TABLE [sys_menu]
 (
-    [menu_id]     bigint IDENTITY (1,1)       NOT NULL,
+    [menu_id]     bigint                      NOT NULL,
     [menu_name]   nvarchar(50)                NOT NULL,
     [parent_id]   bigint        DEFAULT ((0)) NULL,
     [order_num]   int           DEFAULT ((0)) NULL,
@@ -1240,7 +1240,7 @@
 
 CREATE TABLE [sys_notice]
 (
-    [notice_id]      bigint IDENTITY (1,1)      NOT NULL,
+    [notice_id]      bigint                     NOT NULL,
     [notice_title]   nvarchar(50)               NOT NULL,
     [notice_type]    nchar(1)                   NOT NULL,
     [notice_content] nvarchar(max)              NULL,
@@ -1335,7 +1335,7 @@
 
 CREATE TABLE [sys_oper_log]
 (
-    [oper_id]        bigint IDENTITY (1,1)        NOT NULL,
+    [oper_id]        bigint                       NOT NULL,
     [title]          nvarchar(50)   DEFAULT ''    NULL,
     [business_type]  int            DEFAULT ((0)) NULL,
     [method]         nvarchar(100)  DEFAULT ''    NULL,
@@ -1462,7 +1462,7 @@
 
 CREATE TABLE [sys_post]
 (
-    [post_id]     bigint IDENTITY (1,1)   NOT NULL,
+    [post_id]     bigint                  NOT NULL,
     [post_code]   nvarchar(64)            NOT NULL,
     [post_name]   nvarchar(50)            NOT NULL,
     [post_sort]   int                     NOT NULL,
@@ -1560,7 +1560,7 @@
 
 CREATE TABLE [sys_role]
 (
-    [role_id]             bigint IDENTITY (1,1)      NOT NULL,
+    [role_id]             bigint                     NOT NULL,
     [role_name]           nvarchar(30)               NOT NULL,
     [role_key]            nvarchar(100)              NOT NULL,
     [role_sort]           int                        NOT NULL,
@@ -1912,7 +1912,7 @@
 
 CREATE TABLE [sys_user]
 (
-    [user_id]     bigint IDENTITY (1,1)              NOT NULL,
+    [user_id]     bigint                             NOT NULL,
     [dept_id]     bigint                             NULL,
     [user_name]   nvarchar(30)                       NOT NULL,
     [nick_name]   nvarchar(30)                       NOT NULL,
@@ -2137,7 +2137,7 @@
 
 CREATE TABLE [sys_oss]
 (
-    [oss_id]        bigint IDENTITY (1,1)           NOT NULL,
+    [oss_id]        bigint                          NOT NULL,
     [file_name]     nvarchar(255) DEFAULT ''        NOT NULL,
     [original_name] nvarchar(255) DEFAULT ''        NOT NULL,
     [file_suffix]   nvarchar(10)  DEFAULT ''        NOT NULL,
@@ -2222,7 +2222,7 @@
 
 CREATE TABLE [sys_oss_config]
 (
-    [oss_config_id] bigint IDENTITY (1,1)       NOT NULL,
+    [oss_config_id] bigint                      NOT NULL,
     [config_key]    nvarchar(255) DEFAULT ''    NOT NULL,
     [access_key]    nvarchar(255) DEFAULT ''    NULL,
     [secret_key]    nvarchar(255) DEFAULT ''    NULL,
diff --git a/script/sql/test.sql b/script/sql/test.sql
index 5d70965..fd547e7 100644
--- a/script/sql/test.sql
+++ b/script/sql/test.sql
@@ -1,35 +1,35 @@
 DROP TABLE if EXISTS test_demo;
 CREATE TABLE test_demo
 (
-    id          int(0) NOT NULL AUTO_INCREMENT COMMENT '涓婚敭',
-    dept_id     int(0) NULL DEFAULT NULL COMMENT '閮ㄩ棬id',
-    user_id     int(0) NULL DEFAULT NULL COMMENT '鐢ㄦ埛id',
-    order_num   int(0) NULL DEFAULT 0 COMMENT '鎺掑簭鍙�',
+    id          int(0)       NOT NULL COMMENT '涓婚敭',
+    dept_id     int(0)       NULL DEFAULT NULL COMMENT '閮ㄩ棬id',
+    user_id     int(0)       NULL DEFAULT NULL COMMENT '鐢ㄦ埛id',
+    order_num   int(0)       NULL DEFAULT 0 COMMENT '鎺掑簭鍙�',
     test_key    varchar(255) NULL DEFAULT NULL COMMENT 'key閿�',
     value       varchar(255) NULL DEFAULT NULL COMMENT '鍊�',
-    version     int(0) NULL DEFAULT 0 COMMENT '鐗堟湰',
-    create_time datetime(0) NULL DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
-    create_by   varchar(64) NULL DEFAULT NULL COMMENT '鍒涘缓浜�',
-    update_time datetime(0) NULL DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
-    update_by   varchar(64) NULL DEFAULT NULL COMMENT '鏇存柊浜�',
-    del_flag    int(0) NULL DEFAULT 0 COMMENT '鍒犻櫎鏍囧織',
+    version     int(0)       NULL DEFAULT 0 COMMENT '鐗堟湰',
+    create_time datetime(0)  NULL DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
+    create_by   varchar(64)  NULL DEFAULT NULL COMMENT '鍒涘缓浜�',
+    update_time datetime(0)  NULL DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
+    update_by   varchar(64)  NULL DEFAULT NULL COMMENT '鏇存柊浜�',
+    del_flag    int(0)       NULL DEFAULT 0 COMMENT '鍒犻櫎鏍囧織',
     PRIMARY KEY (id) USING BTREE
 ) ENGINE = InnoDB COMMENT = '娴嬭瘯鍗曡〃';
 
 DROP TABLE if EXISTS test_tree;
 CREATE TABLE test_tree
 (
-    id          int(0) NOT NULL AUTO_INCREMENT COMMENT '涓婚敭',
-    parent_id   int(0) NULL DEFAULT 0 COMMENT '鐖秈d',
-    dept_id     int(0) NULL DEFAULT NULL COMMENT '閮ㄩ棬id',
-    user_id     int(0) NULL DEFAULT NULL COMMENT '鐢ㄦ埛id',
+    id          int(0)       NOT NULL COMMENT '涓婚敭',
+    parent_id   int(0)       NULL DEFAULT 0 COMMENT '鐖秈d',
+    dept_id     int(0)       NULL DEFAULT NULL COMMENT '閮ㄩ棬id',
+    user_id     int(0)       NULL DEFAULT NULL COMMENT '鐢ㄦ埛id',
     tree_name   varchar(255) NULL DEFAULT NULL COMMENT '鍊�',
-    version     int(0) NULL DEFAULT 0 COMMENT '鐗堟湰',
-    create_time datetime(0) NULL DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
-    create_by   varchar(64) NULL DEFAULT NULL COMMENT '鍒涘缓浜�',
-    update_time datetime(0) NULL DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
-    update_by   varchar(64) NULL DEFAULT NULL COMMENT '鏇存柊浜�',
-    del_flag    int(0) NULL DEFAULT 0 COMMENT '鍒犻櫎鏍囧織',
+    version     int(0)       NULL DEFAULT 0 COMMENT '鐗堟湰',
+    create_time datetime(0)  NULL DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
+    create_by   varchar(64)  NULL DEFAULT NULL COMMENT '鍒涘缓浜�',
+    update_time datetime(0)  NULL DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
+    update_by   varchar(64)  NULL DEFAULT NULL COMMENT '鏇存柊浜�',
+    del_flag    int(0)       NULL DEFAULT 0 COMMENT '鍒犻櫎鏍囧織',
     PRIMARY KEY (id) USING BTREE
 ) ENGINE = InnoDB COMMENT = '娴嬭瘯鏍戣〃';
 

--
Gitblit v1.9.3