Good morning friends, I'm using h2 where I backup and restore my versions and created 2 tables to be compared to the database versions,
I'm having the following problem I'm using the sequence in one of the columns and these same sequences work normally until I stop the bank and start again, it ends up getting lost for example, when it stops at 12, I stop the bank and restart it goes to 30 or sometimes 130, how can i fix this error i'm using the latest version.
I am using liquibase and hibernate in my javafx application
I will put the database values :
My url
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:h2:./db/eQRHDatabase;MV_STORE=FALSE;MVCC=FALSE
Model
@Entity
public class Database {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private int id;
@Column(name = "DATE")
private Timestamp date;
@Column(name = "VERSION_DB")
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private int versionDB;
}
Liquibase :
create TABLE DATABASE (
ID INTEGER not null AUTO_INCREMENT,
DATE timestamp AS CURRENT_TIMESTAMP,
VERSION_DB INTEGER not null AUTO_INCREMENT,
PRIMARY KEY (ID)
);
-- rollback DROP TABLE DATABASE;