Switching to LqB 2.0

Hi all,

try to migrate from 1.9.4 => 2.0 RC2 I’m running into several issues.

My configuration. DB: WinXP, MS SQL 2000, Maven 3.0, Sun JVM 1.6.0_13
There is a super-pom for some several projects

<project xmlns=“http://maven.apache.org/POM/4.0.0” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd”>
4.0.0
de.reckittbenckiser
mssql-updater-parent
pom
MSSQL DB updater
2.0
Update MSSQL databases for Reckitt Benckiser Applications

<build>
	<sourceDirectory>src/main/liquibase</sourceDirectory>
	<resources>
		<resource>
	&nbsp; &nbsp; &nbsp; &nbsp; <directory>${basedir}/src/main/liquibase</directory>
	&nbsp; &nbsp; &nbsp; &nbsp; <includes>
	&nbsp; &nbsp; &nbsp; &nbsp; 	<include>**/*.xml</include>
	&nbsp; &nbsp; &nbsp; &nbsp; 	<include>**/*.sql</include>
	&nbsp; &nbsp; &nbsp; &nbsp; 	<include>**/*.csv</include>
	&nbsp; &nbsp; &nbsp; &nbsp; </includes>
		</resource>
	</resources>
	<pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.liquibase</groupId>
				<artifactId>liquibase-maven-plugin</artifactId>
				<version>${liquibase.version}</version>
				<dependencies>
					<dependency>
						<groupId>${mssql.driver.groupId}</groupId>
						<artifactId>${mssql.driver.artifactId}</artifactId>
						<version>${mssql.driver.version}</version>
					</dependency>
				</dependencies>
				<configuration>
					<changeLogFile>${changelog.file}</changeLogFile>
					<url>jdbc:jtds:sqlserver://${mssql.server}:${mssql.url.port};DatabaseName=${mssql.url.databasename}</url>
					<driver>${mssql.driver}</driver>
					<username>${mssql.username}</username>
					<password>${mssql.password}</password>
					<contexts>${changelog.context}</contexts>
					<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
				</configuration>
				<executions>
					<execution>
						<id>generate-step</id>
						<phase>compile</phase>
						<goals>
							<goal>updateSQL</goal>
						</goals>
					</execution>
					<execution>
						<id>update-step</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>update</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</pluginManagement>
</build>

<properties>
	<liquibase.version>2.0-rc2-SNAPSHOT</liquibase.version>
	<mssql.driver.groupId>net.sourceforge.jtds</mssql.driver.groupId>
	<mssql.driver>net.sourceforge.jtds.jdbc.Driver</mssql.driver>
	<mssql.driver.artifactId>jtds</mssql.driver.artifactId>
	<mssql.driver.version>1.2.2</mssql.driver.version>
	<mssql.username>sa</mssql.username>
	<mssql.password></mssql.password>
	<changelog.PATH>${project.build.outputDirectory}</changelog.PATH>
	<changelog.file>${changelog.PATH}/changeset-${project.artifactId}.xml</changelog.file>
	<changelog.context>current</changelog.context>
</properties>
<profiles>
	<profile>
		<id>development</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.liquibase</groupId>
					<artifactId>liquibase-maven-plugin</artifactId>
					<version>${liquibase.version}</version>
					<configuration>
						<contexts>development</contexts>
					</configuration>
				</plugin>
			</plugins>
		</build>
	</profile>
	<profile>
		<id>production</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.liquibase</groupId>
					<artifactId>liquibase-maven-plugin</artifactId>
					<version>${liquibase.version}</version>
					<configuration>
						<contexts>production</contexts>
					</configuration>
				</plugin>
			</plugins>
		</build>
	</profile>
</profiles>

therefore
mvn compile generates sql scripts only
mvn package does first step and executes ones against database.

Issue 1. (annoying)

C:\dev\reckitt\dotnet\filling\liquibase\filling>mvn package -Pdevelopment
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Update Filling DB 2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.4.1:resources (default-resources) @ filling —
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 65 resources
[INFO]
[INFO] — maven-compiler-plugin:2.0.2:compile (default-compile) @ filling —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — liquibase-maven-plugin:2.0-rc2-SNAPSHOT:updateSQL (generate-step) @ filling —
[INFO] ------------------------------------------------------------------------
[INFO] there are no resolved artifacts for the Maven project.
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
[INFO] Output SQL Migration File: C:\dev\reckitt\dotnet\filling\liquibase\filling\target\liquibase\migrate.sql
[INFO] Executing on Database: jdbc:jtds:sqlserver://localhost:1433;DatabaseName=filling
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
25.12.2009 23:47:36 liquibase.logging.JavaUtilLogger info
INFO: Successfully acquired change log lock
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect

Hint. May be add some kind of dependency to the liquibase-maven-plugin?

Issue 2. (showstopper)
running against 1.9.5 project does not make conversion of DatabaseChangelog table silently.
UpdateSQL produces correct scripts, that can be manually applied via interactive SQL utility:

– *********************************************************************
– Update Database Script
– *********************************************************************
– Change Log: C:/dev/reckitt/MischungAppl/trunk/mischung-dbupdate/transfer05/target/classes/changeset-transfer05.xml
– Ran at: 27.12.09 00:21
– Against: sa@jdbc:jtds:sqlserver://localhost:1433;DatabaseName=transfer05
– LiquiBase version: 2.0-rc2-SNAPSHOT
– *********************************************************************

– Lock Database
– Adding missing databasechangelog.orderexecuted column
– Modifying size of databasechangelog.md5sum column
– Modifying size of databasechangelog.liquibase column
– Adding missing databasechangelog.exectype column
– DatabaseChangeLog checksums are an incompatible version.  Setting them to null so they will be updated on next database update
ALTER TABLE [dbo].[DATABASECHANGELOG] ADD [ORDEREXECUTED] INT
GO

UPDATE [dbo].[DATABASECHANGELOG] SET [ORDEREXECUTED] = -1
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [ORDEREXECUTED] INT NOT NULL
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [MD5SUM] VARCHAR(35)
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [LIQUIBASE] VARCHAR(20)
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ADD [EXECTYPE] VARCHAR(10)
GO

UPDATE [dbo].[DATABASECHANGELOG] SET [EXECTYPE] = ‘EXECUTED’
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [EXECTYPE] VARCHAR(10) NOT NULL
GO

UPDATE [dbo].[DATABASECHANGELOG] SET MD5SUM=null
GO

but direct mvn liquibase:update produce an error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.797s
[INFO] Finished at: Mon Dec 28 12:22:49 CET 2009
[INFO] Final Memory: 2M/6M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0-rc2-SNAPSHOT:updateSQL (generate-step) on project pim2: Error setting up or running Liquibase: E
rror executing SQL SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG FROM [dbo].[DATABASECHANGELOG] ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC: Ungⁿltig
er Spaltenname ‘ORDEREXECUTED’. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Issue 3 (improvements)
After executing the scripts manually
mvn liquibase:update tried to recalulate the checksums. If changeSet has attribute runOnChange=“false” it updates only checksum
if runOnChange=“true” it generate the body of change log too. IMO in last case better do not generate the body.

Issue 4 (suggestion)
May be add  a separate command to liquibase command at update, updateSql etc. level that could explicit perform such type of changing? name it i.e. upgrade-liquibase. It’ll help to protect from accidentally changing of the current projects.

Thoughts?

Cheers, Oleg

Thanks for the post, I’ll reply to each of your parts separately to make it easier to follow.  I may not get to all of them today, if not I’ll try to reply to them all in the next day or two (will be away from computer a lot). 

Nathan

Originally posted by: taranenko

Issue 1. (annoying)

C:\dev\reckitt\dotnet\filling\liquibase\filling>mvn package -Pdevelopment
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Update Filling DB 2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.4.1:resources (default-resources) @ filling —
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 65 resources
[INFO]
[INFO] — maven-compiler-plugin:2.0.2:compile (default-compile) @ filling —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — liquibase-maven-plugin:2.0-rc2-SNAPSHOT:updateSQL (generate-step) @ filling —
[INFO] ------------------------------------------------------------------------
[INFO] there are no resolved artifacts for the Maven project.
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
[INFO] Output SQL Migration File: C:\dev\reckitt\dotnet\filling\liquibase\filling\target\liquibase\migrate.sql
[INFO] Executing on Database: jdbc:jtds:sqlserver://localhost:1433;DatabaseName=filling
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
25.12.2009 23:47:36 liquibase.logging.JavaUtilLogger info
INFO: Successfully acquired change log lock
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateDatabase: Missing dependency org/hibernate/cfg/Configuration
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.database.core.HibernateGenericDialect: Missing dependency org/hibernate/dialect/Dialect
WARNING 25.12.09 23:47:liquibase: Could not configure extension class liquibase.snapshot.core.HibernateDatabaseSnapshotGenerator: Missing dependency org/hibernate/diale
ct/Dialect

Hint. May be add some kind of dependency to the liquibase-maven-plugin?

I do want to keep warnings about unable to load extensions due to errors, but the hibernate one is a bit different because most people are fine with it not loading correctly.  I’ve been thinking about pulling the hibernate support out into an extension 2.0 and not shipping it with the core which would solve this issue.  Otherwise I should just catch the hibernate errors as a single error message.

Nathan

Originally posted by: taranenko

Issue 2. (showstopper)
running against 1.9.5 project does not make conversion of DatabaseChangelog table silently.
UpdateSQL produces correct scripts, that can be manually applied via interactive SQL utility:

– *********************************************************************
– Update Database Script
– *********************************************************************
– Change Log: C:/dev/reckitt/MischungAppl/trunk/mischung-dbupdate/transfer05/target/classes/changeset-transfer05.xml
– Ran at: 27.12.09 00:21
– Against: sa@jdbc:jtds:sqlserver://localhost:1433;DatabaseName=transfer05
– LiquiBase version: 2.0-rc2-SNAPSHOT
– *********************************************************************

– Lock Database
– Adding missing databasechangelog.orderexecuted column
– Modifying size of databasechangelog.md5sum column
– Modifying size of databasechangelog.liquibase column
– Adding missing databasechangelog.exectype column
– DatabaseChangeLog checksums are an incompatible version.  Setting them to null so they will be updated on next database update
ALTER TABLE [dbo].[DATABASECHANGELOG] ADD [ORDEREXECUTED] INT
GO

UPDATE [dbo].[DATABASECHANGELOG] SET [ORDEREXECUTED] = -1
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [ORDEREXECUTED] INT NOT NULL
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [MD5SUM] VARCHAR(35)
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [LIQUIBASE] VARCHAR(20)
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ADD [EXECTYPE] VARCHAR(10)
GO

UPDATE [dbo].[DATABASECHANGELOG] SET [EXECTYPE] = ‘EXECUTED’
GO

ALTER TABLE [dbo].[DATABASECHANGELOG] ALTER COLUMN [EXECTYPE] VARCHAR(10) NOT NULL
GO

UPDATE [dbo].[DATABASECHANGELOG] SET MD5SUM=null
GO

but direct mvn liquibase:update produce an error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.797s
[INFO] Finished at: Mon Dec 28 12:22:49 CET 2009
[INFO] Final Memory: 2M/6M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0-rc2-SNAPSHOT:updateSQL (generate-step) on project pim2: Error setting up or running Liquibase: E
rror executing SQL SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG FROM [dbo].[DATABASECHANGELOG] ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC: Ungⁿltig
er Spaltenname ‘ORDEREXECUTED’. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Upgrading of the databasechangelog table should happen silently.  I’ve tested it before, something must have regressed.  I’ll have to look into it.  It will be a few days until I am able to though.

Nathan

Originally posted by: taranenko

Issue 3 (improvements)
After executing the scripts manually
mvn liquibase:update tried to recalulate the checksums. If changeSet has attribute runOnChange=“false” it updates only checksum
if runOnChange=“true” it generate the body of change log too. IMO in last case better do not generate the body.

This is going to be an issue with the 1.9->2.0 conversion.  We changed the checksum format and way it is computed so it is not compatible, and so there is no way to know if a change actually happened or not.

I’ve been trying to think through what makes the most sense for runOnChange changeSets: assume the changeSet changed or assume it did not.  Currently it assumes that it has changed, but perhaps that is not the best assumption.  If we assume that it did not change, for people who will have a problem with the checksum upgrade, they can run 1.9 liquibase and make sure all changeSets are up to date, then upgrade to 2.0 right away and have nothing run.

I’ll think through it a bit more, but that is probably something we will have to change.

Nathan

Originally posted by: taranenko

Issue 4 (suggestion)
May be add  a separate command to liquibase command at update, updateSql etc. level that could explicit perform such type of changing? name it i.e. upgrade-liquibase. It’ll help to protect from accidentally changing of the current projects.

I think silent upgrading of the databasechangelog table is best, that way people don’t have to worry about it, and it will work fine even in auto-upgrade cases (like the servlet listener or from within spring).  You could run into issues, but I plan to point out possible cases and suggest backing up the databasechangelog table before upgrading as a fallback measure.

Nathan

Let me know when you change something concerns with the issues. I will check ones on my environment.

Thanks, Oleg