Quantcast
Channel: Liquibase Forums
Viewing all 2993 articles
Browse latest View live

Re : Informix generateChangeLog issue

$
0
0
Unlikely to be a Liquibase bug. Try running with --logLevel=debug. If you can't figure out the problem with that, make sure your reply has details on what command you did as well as the debug output. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : Informix generateChangeLog issue

$
0
0
Hi Steve,

Here is the command -

liquibase --changeLogFile=changelog.xml --url="jdbc:informix-sqli://172.28.137.182:9088/glsnextgen:informixserver=testgif" --username=abc --password=abc --logLevel=debug --logFile=log.txt generateChangeLog 

Liquibase 'generateChangeLog' Successful


Here is the debug output - 

DEBUG 18/2/15 10:37 AM: liquibase: Connected to santhosh@jdbc:informix-sqli://172.28.137.182:9088/glsnextgen:informixserver=testgif
DEBUG 18/2/15 10:37 AM: liquibase: Setting auto commit to false from true
DEBUG 18/2/15 10:37 AM: liquibase: Executing EXECUTE database command: EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('T');
INFO 18/2/15 10:37 AM: liquibase: Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL call current_schema: A syntax error has occurred.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:132)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:318)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:301)
at liquibase.CatalogAndSchema.customize(CatalogAndSchema.java:132)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:116)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.java:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxCallableStatement.<init>(IfxCallableStatement.java:132)
at com.informix.jdbc.IfxSqliConnect.i(IfxSqliConnect.java:5932)
at com.informix.jdbc.IfxSqliConnect.prepareCall(IfxSqliConnect.java:2140)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:95)
... 17 more
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 25 more
DEBUG 18/2/15 10:37 AM: liquibase: Computed checksum for 1424236030375 as 9bac50feef8f4d4b1c1f6d291ac63b0a
INFO 18/2/15 10:37 AM: liquibase: Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL call current_schema: A syntax error has occurred.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:132)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:318)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:301)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:43)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:163)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:60)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:37)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:25)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.java:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxCallableStatement.<init>(IfxCallableStatement.java:132)
at com.informix.jdbc.IfxSqliConnect.i(IfxSqliConnect.java:5932)
at com.informix.jdbc.IfxSqliConnect.prepareCall(IfxSqliConnect.java:2140)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:95)
... 30 more
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 38 more
INFO 18/2/15 10:37 AM: liquibase: Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL call current_schema: A syntax error has occurred.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:132)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:318)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:301)
at liquibase.CatalogAndSchema.standardize(CatalogAndSchema.java:81)
at liquibase.CatalogAndSchema.customize(CatalogAndSchema.java:119)
at liquibase.database.AbstractJdbcDatabase.getSchemaFromJdbcInfo(AbstractJdbcDatabase.java:1329)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.toCatalogAndSchema(SchemaSnapshotGenerator.java:96)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:65)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:163)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:60)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:37)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:25)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.java:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxCallableStatement.<init>(IfxCallableStatement.java:132)
at com.informix.jdbc.IfxSqliConnect.i(IfxSqliConnect.java:5932)
at com.informix.jdbc.IfxSqliConnect.prepareCall(IfxSqliConnect.java:2140)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:95)
... 34 more
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 42 more
INFO 18/2/15 10:37 AM: liquibase: Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL call current_schema: A syntax error has occurred.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:132)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:318)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:301)
at liquibase.CatalogAndSchema.standardize(CatalogAndSchema.java:81)
at liquibase.diff.compare.core.SchemaComparator.isSameObject(SchemaComparator.java:34)
at liquibase.diff.compare.DatabaseObjectComparatorChain.isSameObject(DatabaseObjectComparatorChain.java:43)
at liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject(DatabaseObjectComparatorFactory.java:147)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:70)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:163)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:60)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:37)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:25)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.java:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxCallableStatement.<init>(IfxCallableStatement.java:132)
at com.informix.jdbc.IfxSqliConnect.i(IfxSqliConnect.java:5932)
at com.informix.jdbc.IfxSqliConnect.prepareCall(IfxSqliConnect.java:2140)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:95)
... 34 more
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 42 more
INFO 18/2/15 10:37 AM: liquibase: Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL call current_schema: A syntax error has occurred.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:132)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:318)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:301)
at liquibase.CatalogAndSchema.standardize(CatalogAndSchema.java:81)
at liquibase.CatalogAndSchema.customize(CatalogAndSchema.java:119)
at liquibase.database.AbstractJdbcDatabase.getSchemaFromJdbcInfo(AbstractJdbcDatabase.java:1329)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.toCatalogAndSchema(SchemaSnapshotGenerator.java:96)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:65)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:163)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:60)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:37)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:25)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.java:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxCallableStatement.<init>(IfxCallableStatement.java:132)
at com.informix.jdbc.IfxSqliConnect.i(IfxSqliConnect.java:5932)
at com.informix.jdbc.IfxSqliConnect.prepareCall(IfxSqliConnect.java:2140)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:95)
... 34 more
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 42 more
INFO 18/2/15 10:37 AM: liquibase: Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL call current_schema: A syntax error has occurred.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:132)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:318)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:301)
at liquibase.CatalogAndSchema.standardize(CatalogAndSchema.java:81)
at liquibase.diff.compare.core.SchemaComparator.isSameObject(SchemaComparator.java:34)
at liquibase.diff.compare.DatabaseObjectComparatorChain.isSameObject(DatabaseObjectComparatorChain.java:43)
at liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject(DatabaseObjectComparatorFactory.java:147)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:70)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:163)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:60)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:37)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:25)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.java:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxCallableStatement.<init>(IfxCallableStatement.java:132)
at com.informix.jdbc.IfxSqliConnect.i(IfxSqliConnect.java:5932)
at com.informix.jdbc.IfxSqliConnect.prepareCall(IfxSqliConnect.java:2140)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:95)
... 34 more
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 42 more
INFO 18/2/15 10:37 AM: liquibase: changelog.xml does not exist, creating
DEBUG 18/2/15 10:37 AM: liquibase: MissingObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.ForeignKey    liquibase.structure.core.Index    liquibase.structure.core.View
DEBUG 18/2/15 10:37 AM: liquibase: UnexpectedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.StoredProcedure    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View    liquibase.structure.core.Table    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Column    liquibase.structure.core.Index    liquibase.structure.core.Sequence
DEBUG 18/2/15 10:37 AM: liquibase: ChangedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Index    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View


Thanks for the help !

Re : Informix generateChangeLog issue

$
0
0
Following up on my previous post, I've added the defaultSchema and my command now looks like this - 

liquibase --changeLogFile=changelog.xml --url="jdbc:informix-sqli://172.28.137.182:9088/glsnextgen:informixserver=testgif" --username=abc --password=abc --logLevel=debug --logFile=log.txt --defaultSchema=sysmaster generateChangeLog

However, the generated changelog still has no changesets. This is what the changelog looks like - 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"/>


This is what my debug log looks like - 

DEBUG 18/2/15 11:22 AM: liquibase: Connected to santhosh@jdbc:informix-sqli://172.28.137.182:9088/glsnextgen:informixserver=testgif

DEBUG 18/2/15 11:22 AM: liquibase: Setting auto commit to false from true

DEBUG 18/2/15 11:22 AM: liquibase: Executing EXECUTE database command: EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('T');

DEBUG 18/2/15 11:22 AM: liquibase: Computed checksum for 1424238728847 as 9ed2ff6dc6133a2a2bb8f27d79bd1597

INFO 18/2/15 11:22 AM: liquibase: changelog1.xml does not exist, creating

DEBUG 18/2/15 11:22 AM: liquibase: MissingObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.ForeignKey    liquibase.structure.core.Index    liquibase.structure.core.View

DEBUG 18/2/15 11:22 AM: liquibase: UnexpectedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.StoredProcedure    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View    liquibase.structure.core.Table    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Column    liquibase.structure.core.Index    liquibase.structure.core.Sequence

DEBUG 18/2/15 11:22 AM: liquibase: ChangedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Index    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View



Re : FILENAME column in databasechangelog table.

$
0
0
Wondering if anyone can shed some light on this.

How to create a "super"-table which will be always created infront of any table?

$
0
0
Hello all, 

I am new to this community. So sorry if I am doing something wrong.

I have the requirement, that all tables need some specific columns. this are:
- id (primary key)
- uuid (unique key for offline handling)
- createTimestamp
- createUserId
- updateTimestamp
- updateUserId

I would like to have some template file, which I just include into all new files.

Is there any supported solution?

bye Hans

Re : How to create a "super"-table which will be always created infront of any table?

$
0
0
This is a good place for these kinds of questions. There is also StackOverflow - tag your question 'liquibase'. There are many more people on StackOverflow, so you may get quicker response there rather than here. 

On to your question. As with most things, the answer is 'it depends'. How do you want to use Liquibase? If you intend to use the XML changelog format and enforce that all changes to all database instances are made by developers/DBAs making additions to the XML changelog (or included XML files) then one of the simplest things to do would be to just use the standard XML 'entity include' mechanism. To do that, you would declare the 'standard' columns as an XML entity, and then everywhere you use the createTable tag, you include the entity with the standard columns. 


This of course leaves you open to mistakes and other issues.
- what if someone forgets to include the standard columns? Do you have some other mechanism to check that they are there before deploying to a given database? 
- what if the set of standard columns changes in the future? How will you approach that?

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : How to create a "super"-table which will be always created infront of any table?

$
0
0
Hello Steve,

many thanks for you quick response.

I am using right now the XML format.

Before going on for me it is not clear what you mean with: 
"If you intend to use the XML changelog format and enforce that all changes to all database instances are made by developers/DBAs making additions to the XML changelog"
Sounds like you would recommend a different approach?

Back to the previous question.

Here our template table file:  000_DefaultTableTemplate.xml
  1. <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2.     xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
  3.     xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
  4.         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd
  5.         http://www.liquibase.org/xml/ns/dbchangelog-ext
  6.         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

  7.     <changeSet author="${table.author}" id="${changeset.name}_DefaultTable">
  8.         <createTable schemaName="${table.schema}" tableName="${table.name}">
  9.             <column name="id" type="int" remarks="surrogate key for the row" />
  10.             <column name="uuid" type="uuid" remarks="additional surrogate key for the row, which ensures also uniqueness over mulitple database instances"/>
  11.             <column name="rowCreatedUserId" type="${varchar50}" remarks="userId of the user who created this row"/>
  12.             <column name="rowCreated" type="timestamp" remarks="insert timestamp of this row, timestamp stores data in UTC" />
  13.             <column name="rowUpdatedUserId" type="${varchar50}" remarks="userId of the user who last updated this row"/>
  14.             <column name="rowUpdated" type="timestamp" remarks="last update timestamp of this row, timestamp stores data in UTC" />
  15.         </createTable>

  16.         <!-- mandatory not null constraints on default columns -->
  17.         <addNotNullConstraint columnName="id" columnDataType="int" schemaName="${table.schema}" tableName="${table.name}" />
  18.         <addNotNullConstraint columnName="uuid"  columnDataType="uuid" schemaName="${table.schema}" tableName="${table.name}" />
  19.         <!-- TODO: disabled until user management is available <addNotNullConstraint columnName="rowCreatedUserId" columnDataType="${varchar50}" schemaName="${table.schema}" tableName="${table.name}" /> -->
  20.         <addNotNullConstraint columnName="rowCreated" columnDataType="timestamp" schemaName="${table.schema}" tableName="${table.name}" />
  21.         <!-- TODO: disabled until user management is available<addNotNullConstraint columnName="rowUpdatedUserId" columnDataType="${varchar50}" schemaName="${table.schema}" tableName="${table.name}" /> -->
  22.         <addNotNullConstraint columnName="rowUpdated" columnDataType="timestamp" schemaName="${table.schema}" tableName="${table.name}" />

  23.         <!-- create primary key -->
  24.         <addPrimaryKey columnNames="id" constraintName="pk_${table.name}" schemaName="${table.schema}" tableName="${table.name}" />
  25.         <addAutoIncrement columnName="id" columnDataType="int" tableName="${table.name}" />

  26.         <!-- create unique index on uuid -->
  27.         <createIndex indexName="Idx${table.name}Uuid" unique="true" schemaName="${table.schema}" tableName="${table.name}" >
  28.             <column name="uuid" type="varchar(255)" />
  29.         </createIndex>
  30.     </changeSet>
  31. </databaseChangeLog>
and the other files including it:

Translation.xml
  1. <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2.     xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
  3.     xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd
  4.         http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

  5.     <!-- include the default properties -->
  6.     &propertiesAll;

  7.     <property name="table.schema" value="${schema}" />
  8.     <property name="table.name" value="Translations" />
  9.     <property name="table.author" value="hkais" />
  10.     <property name="changeset.number" value="001" />
  11.     <property name="changeset.operation" value="Create" />
  12.     <property name="changeset.name" value="${changeset.number}_${changeset.operation}${table.name}" />

  13.     <!-- create default table ${table.name} -->
  14.     <include file="000_DefaultTableTemplate.xml" relativeToChangelogFile="true" />

  15.     <changeSet author="${table.author}" id="${changeset.name}">
  16.         <addColumn schemaName="${schema}" tableName="${table.name}">
  17.             <column name="locale" type="${varchar5}" beforeColumn="rowCreatedUserId" remarks="translation locale" />
  18.         </addColumn>
  19.         <addNotNullConstraint columnName="locale" columnDataType="${varchar5}" schemaName="${table.schema}" tableName="${table.name}" />
  20. </changeSet>
The varchar properties are imported as xml entities at one place, so we have some defaults for the developers and to keep them same for the DBAs to administer their storages/tablespaces.
With the above changesets we have nearly our solution, but only nearly.
The issue now is, since we are using the property  ${changeset.name}_DefaultTable and we assumed this property gets renewed on every new changeset file like the Translation.xml we get a collision due to duplicateded ids of the changeset. So this lets me assume the properties are immutable, or I am doing something wrong?

We could debug in more depth in the IDE, but we would need some advice there to take a look.

best wishes

Re : generateChangeLog for multiple schemas in MySQL

$
0
0
No comments?  Is the JDBC URL supposed to be all that's exported?

Re : How to create a "super"-table which will be always created infront of any table?

$
0
0
On the first question - I am not recommending any particular approach to using Liquibase - I just know that there are many different ways it can be used. One of the most common things we have seen is that teams don't want to author database changes in XML - they want to make changes using the vendor-provided GUIs and then use Liquibase diffChangelog to create the XML. It sounds like your team is OK with editing XML.

But back to your real question.

You are correct that when Liquibase processes the XML files that properties are immutable - once they are set, they cannot change. 

I think your options are to either look at something like XSLT or something else to pre-process the XML files or else you could write your own Liquibase changelog tag implementation that 'extends' the existing createTable tag and automatically creates the required columns. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : generateChangeLog for multiple schemas in MySQL

$
0
0
The way that Liquibase is designed, it only works with a single schema at a time. I believe that support for multiple schemas would be a difficult change. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Liquibase removes grant after updating function (DB - PostgreSQL)

$
0
0
Hi All,

I am having issue with executing sql script with liquibase.

Every first time executing sql function with liquibase, creates all the required grants for the PLSQL function.

When modify the existing function and rerun script using liquibase, it removes grants.

Please help me in solving this issue.

Thanks,
Irfan

Liquibase reverted grant after updating PLSQL function (DB - PostgreSQL)

$
0
0
Hi All,

I am having issue with executing sql script with liquibase.

Every first time executing sql function with liquibase, creates all the required grants for the PLSQL function.

When modify the existing function and rerun script using liquibase, it removes grants.

Please help me in solving this issue.

Thanks,
Irfan

Loading data with dates in Oracle throws DatabaseException

$
0
0
Loading data with dates in Oracle throws the following exception:  

liquibase.exception.DatabaseException: java.sql.SQLException: ORA-01861: literal does not match format string

The simplified create statement (PostgreSQL) of table Usr is as follows:

CREATE TABLE "public".usr_specs ( 
usr_specs_id         serial  NOT NULL,
usr_id               integer  NOT NULL,
usr_name             varchar(255)  NOT NULL,
usr_fullname         varchar(100)  NOT NULL,
descr                varchar(255)  ,
blocked              integer  ,
d_beg                date  NOT NULL,
d_end                date  ,
dt_rec               timestamp  NOT NULL,
dt_sup               timestamp  ,
mut_usr_id           integer  NOT NULL,
sup_usr_id           integer  ,
email                varchar(255)  ,
tel                  varchar(40)  ,
CONSTRAINT pk_usr_specs PRIMARY KEY ( usr_specs_id )
 );

This is the contents of usr_specs.csv:

usr_specs_id,usr_id,usr_name,usr_fullname,descr,blocked,d_beg,d_end,dt_rec,dt_sup,mut_usr_id,sup_usr_id
1,1,admin,Administrator,,0,2000-01-01 00:00:00,NULL,2000-01-01 00:00:00,NULL,1,NULL

Loading the same data into a PostgreSQL database, everything works fine.

Any idea why Liquibase is throwing this exception using a Oracle database?

Re : Loading data with dates in Oracle throws DatabaseException

$
0
0
The problem must be in the format of either some or all the various date and timestamp fields. Oracle is probably more stringent about those than postgres is. The create table statement says that d_beg and d_end are both of type 'date', and that dt_rec and dt_sup are both 'timestamp', but the data for all four fields follows the same format of 'yyyy-mm-dd hh:MM:ss'. You'd have to check the oracle docs for what the correct format is for each of those datatypes.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : Loading data with dates in Oracle throws DatabaseException

$
0
0
You're right, I had to use the date format of 'DD-MM-RR'. This I found out by doing the following query:

SELECT value FROM v$nls_parameters WHERE parameter ='NLS_DATE_FORMAT';

The documentation says that Liquibase will parse dates in CSV files, but that seems to be false. 
Though, it would be very useful if Liquibase parses dates, because else it won't be possible to use the same CSV for Oracle as for PostgreSQL or any other supported database.

Bart Weber
Software Engineer

Re : Loading data with dates in Oracle throws DatabaseException

$
0
0
Ok, found out how to do this:
  1. <changeSet id="20140903-initial-data-usr_specs" author="Bart">
  2.     <loadData
  3.         encoding="UTF-8"
  4.         file="liquibase/initdata/changelog_SNAPSHOT_1/usr_specs.csv"
  5.         tableName="usr_specs">
  6.         <column name="d_beg" type="DATE"/>
  7.         <column name="d_end" type="DATE"/>
  8.         <column name="dt_rec" type="DATETIME"/>
  9.         <column name="dt_sup" type="DATETIME"/>
  10.     </loadData>
  11. </changeSet>
By specifying the date fields, Liquibase parses the date values with the pattern as specified in the documentation: ‘YYYY-MM-DD' or 'hh:mm:ss’ or ‘YYYY-MM-DDThh:mm:ss’.

Now when I think about this matter, it is quite logical that you have to specify to Liquibase what kind of field it has to deal with. But when quick referencing the documentation it was not so quite clear to me. Please, could you add to the documentation an example of loadData with date fields like above?

Bart Weber
Software Engineer

Liquibase gives different results from Ant and the command line

$
0
0
Hi. I raised this on StackOverflow a few days ago, but no-one has answered it there yet, so I thought I would try here.

In short, when I run the Liquibase command, the FILENAME column is populated with values relative to the changelog file. But if I run the same changelog using Ant, the FILENAME column gets the absolute paths of the files.

I'm sure it's something to do with my classpath, but as far as I can see I have the root of the changelog file on there. See the StackOverflow link for the contents of my Ant build file.


Re : How to create a "super"-table which will be always created infront of any table?

$
0
0
Hello together,

From my perspective it would be nice to have a new optional attribute global, which will always be true and will let the property behave as it was before.

<property name="aFileLocalProperty" value="anyPerFileChaningValue"  global="false" />

So the user/developer of the changesets could decide about the visibility of the properties. If ommited, it will behave as it was (global)

Steve, the other option you suggested would be a more private extension. So the reuse of it is very low from my perspective. So from community perspective a choice which is not extending the usability.

We (me and my team) would like to provide a global/local property patch for this change, but we should know if there is a good chance to get incorporated into the main stream of the liquibase. Can you help us on this decission?

bye Darko

Support for Hive (Hadoop) schema changes via Liquibase?

$
0
0
I used to manage database deployments via sourcing .sql text files and it was problematic.

I now have a number of applications a group of us has built whose SQL deployment operations I am managing in Liquibase. Great stuff!

I love the ability in Liquibase to have error handling and incremental idempotency in my SQL deployment operations, both command-line and via Maven builds. Thanks to creative use of RunAlways and Preconditions I am even able to create TDD unit tests for liquibase operations that ensure certain operations run always and can be ensured to remain true as part of each code build or database deployment!

However, the latest of the applications we've built is trying to take our SQL data and push it to Hadoop (via Sqoop) for predictive analysis there that is very computationally intensive.  So I am now also supporting Hive schema on our Hadoop cluster, at least some of which mirrors our SQL schema very closely.  (Hive is an open-source SQL implementation that runs across a Hadoop cluster and can be connected to with a standard JDBC driver.)

So after championing Liquibase amongst my technical peers I find myself in the predicament that I have to return to the days of sourcing some of my DDL in shell scripts with no error handling, and I can't use Liquibase for all DDL changes related to our applications!

I don't really need Liquibase to generate "HiveQL DDL" via its tags, but I at least need to be able to specify such sorts of DDL in a <sql> tag like I do with our existing database-specific DDL in Liquibase.  

It seems plausible/feasible at a high level to me because one just needs to have Liquibase pass the DDL through a JDBC driver and read back the responses, right?  I am probably grossly oversimplifying.

Is deploying DDL for Hive/Hadoop via Liquibase possible via some existing means?  Is this even on the radar for the future?

Re : generateChangeLog for multiple schemas in MySQL

$
0
0
I have a couple years experience using Liquibase with multiple schemas in MySQL and we've tried a few things.

First, I haven't really used generateChangeLog.  Instead, for our initial deployment, I've been able to reverse engineer one or more of our existing schema via MySQL Workbench into MySQL Workbench, and then forward-engineer a DDL-creation script from MySQL Workbench which you paste into a single Liquibase <sql> changeset (with an appropriate custom delimiter).  Or split it up into changesets if you have the time/motivation and as you see fit.  But then- trust me-don't ever edit those changesets.  Always do all changes as incremental liquibase changeset operations from that point forward unless you want to enter a world of pain.

We basically found two approaches to dealing with multiple schemas:

1) Deploy multiple schema changes via a single Liquibase deployment operation.  (By "liquibase deployment operation" I mean I mean an execution of Liquibase via command line or Maven).  Set the JDBC URL to default to some schema where you want the DATABASECHANGELOG to live and within your changeset's <sql> tags explicitly specify the schema names you want to be working with, e.g. CREATE TABLE foo.tablea;  CREATE TABLE bar.tableb, etc.  (If you don't specify a schema name explicitly, the operations will occur in the default schema specified by your JDBC URL and/or default MySQL settings.)  

2) Deploy multiple schema changes via multiple Liquibase deployment operations.  Set the JDBC URL for each schema to the schema you are deploying and you will end up with a DATABASECHANGELOG table in each schema associated with the changes related to that schema.  Don't specify the schemanames in any of your changesets; control that via the JDBC settings only.  You may end up having one master.xml file for each schema however (masterDeploySchemaA.xml, masterDeploySchemaB.xml, masterDeploySchemaC.xml) and you invoke the appropriate one combined with the matching JDBC URL.



Despite starting with approach #1, we found over time that #2 is a bit clearer and less error prone. The problem with approach #1 is that when a DBA or developer backs up and restores a schema, they are not always careful to restore the corresponding DATABASECHANGELOG located in the default/central schema, and that leads to real problems!!  We had a nasty production issue crop up once due to that.

Much better to have your DATABASECHANGELOG for all changes related to a schema collocated with the schema itself, and this in turn requires that you invoke Liquibase multiple times, once for each schema and that you have a different JDBC URL for each invocation.  

Regarding your concern about foreign keys across schemas, this shouldn't be a problem. As long as you control the Liquibase ordering of invocation for schema A vs schema B, you can ensure that cross-schema FKs are setup after both the source tables are setup (ie if you deploy schema A first, add the foreign key in B pointing to A as a later changeset associated with schema B.)  

If you have a complex nest of foreign keys that prevents a straight sequential deployment of schema A then B (with foreign keys to A) then C (with foreign keys to A or B), you may want to either have additional deployment operations and changesets that do the foreign keys after all the tables are setup (deploySchemaA.xml, deploySchemaB.xml, deploySchemaC.xml, deploySchemaA_FK.xml, deploySchemaB_FK.xml, deploySchemaC_FK.xml). 

Or you may want to use one-deployment-per-schema changesets (deploySchemaA.xml, deploySchemaB.xml, deploySchemaC.xml) with FK changesets that employ "runAlways" and "Preconditions" so you only attempt to create the FKs if both source and target tables/columns are present (and the FK is not present).  In that case, if you run your deployments twice, any cross-schema FKs not created the first time will get created the second time.

  --Greg

Viewing all 2993 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>