-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
Could you please handle properly situation when TableUtils.createTableIfNotExists() method is used to add CREATE SEQUENCE IF NOT EXISTS in Postgres database imlementation?
Becasue now it fails due to even if CREATE TABLE has IF NOT EXISTS statement, CREATE SEQUENCE has not.
Exception in thread "main" java.sql.SQLException: SQL statement failed: CREATE SEQUENCE "local_user_session_id_seq"
at com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:395)
at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:371)
at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:356)
at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:74)
at vision.combat.c4.node.ormlite.ORMCoreDataManager.<init>(ORMCoreDataManager.kt:17)
at vision.combat.c4.node.ApplicationKt.initCore(Application.kt:119)
at vision.combat.c4.node.ApplicationKt.main(Application.kt:38)
Caused by: org.postgresql.util.PSQLException: ERROR: SEQUENCE "local_user_session_id_seq" already exists
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2734)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2421)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:518)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:196)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:182)
at com.j256.ormlite.jdbc.JdbcCompiledStatement.runExecute(JdbcCompiledStatement.java:73)

Metadata
Metadata
Assignees
Labels
No labels