postgresql Quarkus liquibase postgres更新分配大小序列

tpxzln5u  于 11个月前  发布在  PostgreSQL
关注(0)|答案(1)|浏览(123)

我尝试使用quarkus postgres和liquibase更新实体的值增量(allocationSize),问题是这些值不一致的抛出错误
用于更新序列的脚本

alter sequence ID_SEQ increment by 100;

entity

    @Entity
    @Table(name = "ENTITY")
    @SequenceGenerator(name = "ID_SEQ", sequenceName = "ID_SEQ", allocationSize = 100)
    public class ENTITY extends PanacheEntityBase

字符串
我得到的错误
架构验证:序列[ID_SEQ]定义的增量大小不一致;找到[1],但应为[100]

kb5ga3dv

kb5ga3dv1#

您必须使用sequenceGenerator注解字段(例如:id),而不是实体或类。

@Entity
@Table(name = "ENTITY")
public class ENTITY extends PanacheEntityBase{

@Id
@SequenceGenerator(name = "ID_SEQ", sequenceName = "ID_SEQ", allocationSize =100)
public Integer id;

}

字符串

相关问题