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
I'm using Spring Boot 1.5.2 with Hibernate 5 and try to support as many databases as possible (i.e: Hibernate will create all the tables in SQLite 3, then I use Liquibase as an abstract layer to generate the XML change-log files for all kind of supported databases which Liquibase claimed: supported databases).
so I added the dependency for Liquibase in pom.xml (Maven).
I have some configuration in liquibase.properties to connect to SQLite3 datab file, then I can run this command to create a changelog file.
mvn liquibase:generateChangeLog
The output changelog I cannot recreate in another different SQLite 3 db file, due to the addPrimaryKey element:
and the error in Java Spring Boot when it starts:
addPrimaryKey is not supported on sqlite,
classpath:/database_versions/db.changelog-master.xml::1497366115846-62::rasdaman (generated)
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:266)
at liquibase.Liquibase.update(Liquibase.java:210)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:388)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
If I use the generated output file from SQLite by Liquibase and allow Spring Boot to starts with Postgresql datasource, I got another error:
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'liquibase' defined in class path resource
[org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set classpath:/database_versions/db.changelog-master.xml::1497366115846-1:: (generated):
Reason: liquibase.exception.DatabaseException: ERROR: syntax error at or near "("
Position: 72 [Failed SQL: CREATE TABLE public."HT_abstract_coverage" (abstract_coverage_id BIGINT(2000000000, 10) NOT NULL, hib_sess_id CHAR(36))]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
So it seems I don't have another tool to generate an abstract data file like XML automatically which can be imported to any common databases without problems? If you have any suggestion, please advise!
Copied from: https://stackoverflow.com/questions/44525671/java-hibernate-liquibase-supports-cross-databases-and-sqlite
I'm using Spring Boot 1.5.2 with Hibernate 5 and try to support as many databases as possible (i.e: Hibernate will create all the tables in SQLite 3, then I use Liquibase as an abstract layer to generate the XML change-log files for all kind of supported databases which Liquibase claimed: supported databases).
so I added the dependency for Liquibase in pom.xml (Maven).
and a plugin to generate the changelog XML file from created database of Hibernate
org.liquibase liquibase-maven-plugin 3.5.3mvn liquibase:generateChangeLog
and the error in Java Spring Boot when it starts:The output changelog I cannot recreate in another different SQLite 3 db file, due to the addPrimaryKey element:
addPrimaryKey is not supported on sqlite,
classpath:/database_versions/db.changelog-master.xml::1497366115846-62::rasdaman (generated)
If I use the generated output file from SQLite by Liquibase and allow Spring Boot to starts with Postgresql datasource, I got another error:
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'liquibase' defined in class path resource
[org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set classpath:/database_versions/db.changelog-master.xml::1497366115846-1:: (generated):
Reason: liquibase.exception.DatabaseException: ERROR: syntax error at or near "("
Position: 72 [Failed SQL: CREATE TABLE public."HT_abstract_coverage" (abstract_coverage_id BIGINT(2000000000, 10) NOT NULL, hib_sess_id CHAR(36))]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
So it seems I don't have another tool to generate an abstract data file like XML automatically which can be imported to any common databases without problems? If you have any suggestion, please advise!
Thanks,
┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: