Skip to content

Commit

Permalink
optimize: mysql中的sql脚本,序列名长度从50加长到255。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Dec 1, 2023
1 parent d655694 commit 013e2a2
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- 建表语句
CREATE TABLE `easyj_sys_sequence`
(
`name` varchar(50) NOT NULL COMMENT '序列的名字,唯一',
`current_value` bigint NOT NULL COMMENT '当前的值',
`increment_value` tinyint NOT NULL DEFAULT 1 COMMENT '步长,默认为1',
`name` varchar(255) NOT NULL COMMENT '序列的名字,唯一',
`current_value` bigint NOT NULL COMMENT '当前的值',
`increment_value` tinyint NOT NULL DEFAULT 1 COMMENT '步长,默认为1',
PRIMARY KEY (`name`) USING BTREE
) COMMENT = '公共的序列表';


-- 获取当前序列值的函数
CREATE FUNCTION func_currval (seq_name varchar(50))
CREATE FUNCTION func_currval (seq_name varchar(255))
RETURNS bigint
DETERMINISTIC
BEGIN
Expand All @@ -33,7 +33,7 @@ END;


-- 获取下个序列值的函数
CREATE FUNCTION func_nextval (seq_name varchar(50))
CREATE FUNCTION func_nextval (seq_name varchar(255))
RETURNS bigint
DETERMINISTIC
BEGIN
Expand All @@ -46,7 +46,7 @@ END;


-- 设置序列值的函数(起到纠正当前值的作用)
CREATE FUNCTION func_setval (seq_name varchar(50), val bigint)
CREATE FUNCTION func_setval (seq_name varchar(255), val bigint)
RETURNS bigint
DETERMINISTIC
BEGIN
Expand Down

0 comments on commit 013e2a2

Please sign in to comment.