You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
之前设计数据库没考虑id长度问题,现在导入apijson后,新增数据的时候报Out of range value for column 'id' at row 1,已知是id长度问题,因为换成bigint类型后就没问题, 但是之前设计的数据库都是int类型,如果要一个一个改工作量非常大,想问这种问题怎么解决?能不能让id自增长(id改成bigint后生成的id好像是时间戳?)?因为之前一直做前端的(需求只是简单的弄一个增删改查的功能,所以没后台),不知道怎么下手,求大佬帮忙
Activity
TommyLemon commentedon Dec 29, 2020
DemoSQLConfig static 代码块中重写 SIMPLE_CALLBACK 的 newId 方法,return null 即可

https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/DemoSQLConfig.java
wengeqiua commentedon Dec 30, 2020
非常感谢
Xuxin19960702 commentedon Aug 28, 2023
环境信息
系统: Windows 7
JDK: 1.8.0_41
APIJSON数据库: MySQL 5.7
远程数据库:MySQL 5.5
APIJSON: APIJSON-MultiDataSource 6.0.0工程
问题描述
你好,DemoSQLConfig静态代码块中重写SIMPLE_CALLBACK的newId方法,返回null后。添加数据时候,仍未使用自增主键。
怀疑原因:是不是远程数据库版本的问题???
(不方便截图,见谅)


错误信息
TommyLemon commentedon Aug 28, 2023
@Xuxin19960702 你是怎么判断没有自增的?最上方两条也是连续的,再添加记录,最新的记录 id 也应该为之前最大 id + 1
Xuxin19960702 commentedon Aug 29, 2023
确实是我魔怔了,昨晚后来我也发现这个问题了,就改当前自增id了,但数据库有点问题,手动insert都改不过来。今早重新改了下自增id,居然就好了。
非常感谢!麻烦了。