Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
3d221d39
Commit
3d221d39
authored
Feb 02, 2019
by
cjl
Browse files
在高版本mysql中minvalue、maxvalue有可能作为保留字导致sql执行失败,修改字段名
parent
8c1213a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
sql/jsh_erp.sql
View file @
3d221d39
...
...
@@ -5253,8 +5253,8 @@ ALTER TABLE jsh_depotitem DROP FOREIGN KEY jsh_depotitem_ibfk_1;
DROP TABLE IF EXISTS `tbl_sequence`;
CREATE TABLE tbl_sequence (
seq_name VARCHAR(50) NOT NULL COMMENT '序列名称',
minvalue bigint(20) NOT NULL COMMENT '最小值',
maxvalue bigint(20) NOT NULL COMMENT '最大值',
min
_
value bigint(20) NOT NULL COMMENT '最小值',
max
_
value bigint(20) NOT NULL COMMENT '最大值',
current_val bigint(20) NOT NULL COMMENT '当前值',
increment_val INT DEFAULT '1' NOT NULL COMMENT '增长步数',
remark VARCHAR(500) DEFAULT null COMMENT '备注',
...
...
@@ -5264,7 +5264,7 @@ CREATE TABLE tbl_sequence (
-- ----------------------------
-- 添加表单据编号sequence
-- ----------------------------
insert into tbl_sequence (seq_name, minvalue, maxvalue, current_val, increment_val,remark) values ('depot_number_seq', 1, 999999999999999999, 1, 1,'单据编号sequence');
insert into tbl_sequence (seq_name, min
_
value, max
_
value, current_val, increment_val,remark) values ('depot_number_seq', 1, 999999999999999999, 1, 1,'单据编号sequence');
-- ----------------------------
-- 创建function _nextval() 用于获取当前序列号
-- ----------------------------
...
...
@@ -5276,7 +5276,7 @@ declare _cur bigint;
declare _maxvalue bigint; -- 接收最大值
declare _increment int; -- 接收增长步数
set _increment = (select increment_val from tbl_sequence where seq_name = name);
set _maxvalue = (select maxvalue from tbl_sequence where seq_name = name);
set _maxvalue = (select max
_
value from tbl_sequence where seq_name = name);
set _cur = (select current_val from tbl_sequence where seq_name = name for update);
update tbl_sequence -- 更新当前值
set current_val = _cur + increment_val
...
...
sql/华夏ERP数据库设计汇总.xlsx
View file @
3d221d39
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment