Re : How to reference new change in xml file
Re : CreateView and schema
Re : Seems like runOnChange or runAlways is default in 3.2.2
Re : Upgrading from 2.0.5 to 3.2.0 - Problem with preConditions ?
Re : Collation support?
Re : Seems like runOnChange or runAlways is default in 3.2.2
Re : Seems like runOnChange or runAlways is default in 3.2.2
Re : Howto set/override changeset description
addNotNullConstraint doesn't work with mysql
- <addNotNullConstraint columnDataType="VARCHAR(64)"
- columnName="permissions"
- defaultNullValue="ROLE_ADMIN"
- schemaName="users"
- tableName="apiTokens"/>
Re : Generating Change Logs for Stored procedures, functions, packages and Triggers
modifySql ignoring isApplyToRollback() property (again?)
Re : modifySql ignoring isApplyToRollback() property (again?)
Liquibase-mysql
Microsoft Azure SQL DB - issue updating with a changelog xml file
I wanted to log this as a bug in Liquibase Jira but it would not allow me to create an account because my email address is an invalid domain. When I run a changeLog XML file against a Microsoft SQL Server 2008 to create my database it works. When I run that same changelog against a Microsoft Azure SQL Database it fails.
The failure has nothing to do with the changeSets in the changeLog XML file; it is failing when trying to insert a record into the "DATABASECHANGELOG" table. That table does not have a clustered index (a requirement of all tables in a Microsoft Azure DB). I noticed that the other liquibase table has a clustered primary key index "DATABASECHANGELOGLOCK", but the one giving the error does not.
Here is the error and my workaround:
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([ID], [AUTHOR], [FILENAME], [DATEEXECUTED], [ORDEREXECUTED], [MD5SUM], [DESCRIPTION], [COMMENTS], [EXECTYPE], [LIQUIBASE]) VALUES ('1408545942766-203', 'Me (generated)', '/Users/Me/Documents/eclipse_workspace/addynamo-scheduler/./dbchangelog-generated-live-fixed.xml', GETDATE(), 2, '7:652dfcadd409a0dadd415554341b75f0', 'createTable', '', 'EXECUTED', '3.2.2'): Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again.
at org.private.service.ManageTestDatabase.ensureCreate(ManageTestDatabase.java:121)
at org.private.scheduler.test.CreateAzureSchema.setUpBeforeClass(CreateAzureSchema.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([ID], [AUTHOR], [FILENAME], [DATEEXECUTED], [ORDEREXECUTED], [MD5SUM], [DESCRIPTION], [COMMENTS], [EXECTYPE], [LIQUIBASE]) VALUES ('1408545942766-203', 'Clive (generated)', '/Users/Clive/Documents/eclipse_workspace/addynamo-scheduler/./dbchangelog-generated-live-fixed.xml', GETDATE(), 2, '7:652dfcadd409a0dadd415554341b75f0', 'createTable', '', 'EXECUTED', '3.2.2'): Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again.
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112)
at liquibase.changelog.StandardChangeLogHistoryService.setExecType(StandardChangeLogHistoryService.java:258)
at liquibase.database.AbstractJdbcDatabase.markChangeSetExecStatus(AbstractJdbcDatabase.java:1068)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:50)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:70)
at liquibase.Liquibase.update(Liquibase.java:195)
at liquibase.Liquibase.update(Liquibase.java:174)
at org.private.service.ManageTestDatabase.ensureCreate(ManageTestDatabase.java:119)
... 17 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:310)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
... 26 more
Running this solves the problem:
- ALTER TABLE [dbo].[DATABASECHANGELOG] ADD CONSTRAINT [PK_DATABASECHANGELOG_ID] PRIMARY KEY CLUSTERED ([ID] ASC);
Liquibase Version: 3.2.2
SQL Driver: Microsoft sqljdbc4 (4.0)
Regards,
Seraph
NullPointerException when running generateChangeLog using MySQL and Liquibase 3.2.2
- liquibase --changeLogFile=changelog.xml generateChangeLog
- driver: com.mysql.jdbc.Driver
- classpath: C:\\Program Files (x86)\\MySQL\\Connector J 5.1.30\\mysql-connector-java-5.1.30-bin.jar
- url: jdbc:mysql://localhost/adtest
- username: root
- password: ***********
- logFile: liquibase.txt
- logLevel:debug
- INFO 8/25/14 1:40 PM: liquibase: changelog.xml does not exist, creating
- DEBUG 8/25/14 1:40 PM: 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
- SEVERE 8/25/14 1:40 PM: liquibase: java.lang.NullPointerException
- liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.NullPointerException
- at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:139)
- at liquibase.integration.commandline.Main.doMigration(Main.java:904)
- at liquibase.integration.commandline.Main.run(Main.java:170)
- at liquibase.integration.commandline.Main.main(Main.java:89)
- Caused by: liquibase.command.CommandExecutionException: java.lang.NullPointerException
- at liquibase.command.AbstractCommand.execute(AbstractCommand.java:13)
- at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:137)
- ... 3 more
- Caused by: java.lang.NullPointerException
- at liquibase.diff.output.changelog.core.MissingForeignKeyChangeGenerator.fixMissing(MissingForeignKeyChangeGenerator.java:43)
- at liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:44)
- at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:99)
- at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:147)
- at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:127)
- at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:73)
- at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:61)
- at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:54)
- at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
- ... 4 more
Need help with using Liquibase with Teradata 14
Re : NullPointerException when running generateChangeLog using MySQL and Liquibase 3.2.2
Re : NullPointerException when running generateChangeLog using MySQL and Liquibase 3.2.2
Re : NullPointerException when running generateChangeLog using MySQL and Liquibase 3.2.2
Liquibase api core log messages not printing
I am working in the liquibase core jar maven for doing the changes in my database. I want to print the Log that was generated in Liquibase core api to my own console.
I am executing the Liquibase as a maven plugin. When i execute it the logs from the maven plugin is displayed, the Plugin inturn calls the main method of the Liquibase API,the logs from that API is not printed to my console.
1.I am running the liquibase from the liquibase core API and executed using below sample for tag.
baseDir = mavenProjectInfo.getBaseDir(); List<String> liquibaseargs = new ArrayList<String>(); log.info("******* Invoking liquibase Tag command *******"); Map<String, String> configs = MojoUtil.getAllValues(configuration); liquibaseargs.add(LIQUIBASE_DRIVER + getDriverName(configs.get(DBTYPE))); liquibaseargs.add(LIQUIBASE_URL + dbURLConstruction(configs.get(HOST), configs.get(PORT), configs.get(DBNAME), configs.get(DBTYPE))); liquibaseargs.add(LIQUIBASE_USERNAME + configs.get(USERNAME)); liquibaseargs.add(LIQUIBASE_PASSWORD + configs.get(PASSWORD)); liquibaseargs.add(TAG); liquibaseargs.add(configs.get(DBTAG)); String liquibasearguments[] = liquibaseargs .toArray(new String[liquibaseargs.size()]); Main.main(liquibasearguments); when i execute the Above the tag will be put on my database.
2.I am using the seperate console for my application, that will print all the log of the operations performed through the UI.
3.I want to print the sucessful or notsucessful of the tag. But using the above API will print only in the command prompt console.