• last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
LDEV-3319: automatically perform 'patches' table upgrade if invalid primary key found.

There is a difference in 'patches' table structure in legacy autopatch and autopatch-1.4.2 version. In new version, primary key is compound and built from 'system_name' and 'patch_level' columns. There was however no validation and upgrade process present to alter primary key. Introduce such mechanism with this commit. If 'patches' table is present, but connection metadata reports single column primary key - 'alter table' query is executed (for MySQL: ALTER TABLE patches DROP PRIMARY KEY, ADD PRIMARY KEY(system_name, patch_level);)

JUnit tests of autopatch component were updated.

LDEV-3319: catch and ignore SQLException thrown when isClosed() condition is checked on Statement. Exemplary stacktrace below.

2014-10-10 20:21:35,092 ERROR [com.tacitknowledge.util.migration.jdbc.util.SqlUtil] (MSC service thread 1-6) Error closing Statement: java.sql.SQLException: The statement is closed.

at org.jboss.jca.adapters.jdbc.WrappedStatement.checkState(WrappedStatement.java:1324)

at org.jboss.jca.adapters.jdbc.WrappedStatement.getUnderlyingStatement(WrappedStatement.java:1239)

at org.jboss.jca.adapters.jdbc.WrappedStatement.getWrappedObject(WrappedStatement.java:1255)

at org.jboss.jca.adapters.jdbc.WrappedStatement.isClosed(WrappedStatement.java:1159)

at com.tacitknowledge.util.migration.jdbc.util.SqlUtil.close(SqlUtil.java:89)

LDEV-3319: Record changes made by jliew (http://code.lamsfoundation.org/fisheye/browse/otherlams/autopatch) on top of autopatch-1.4.2-lams version.

file TestMigrationTaskRollback1.java was initially added on branch lams2_head_wildfly.

file MockBuilder.java was initially added on branch lams2_head_wildfly.

file patch00003-rollback_patch03.sql was initially added on branch lams2_head_wildfly.

file patch00002_patch02.sql was initially added on branch lams2_head_wildfly.

file patch00002-rollback_patch02.sql was initially added on branch lams2_head_wildfly.

file WhinyMigrationListener.java was initially added on branch lams2_head_wildfly.

file TestListener2.java was initially added on branch lams2_head_wildfly.

file TestListener1.java was initially added on branch lams2_head_wildfly.

file TestPostMigrationTask2.java was initially added on branch lams2_head_wildfly.

file TestPostMigrationTask1.java was initially added on branch lams2_head_wildfly.

file BaseTestMigrationTask.java was initially added on branch lams2_head_wildfly.

file patch00004_insert_into_race_3.sql was initially added on branch lams2_head_wildfly.

file patch00003_insert_into_race_2.sql was initially added on branch lams2_head_wildfly.

file patch00002_insert_into_race.sql was initially added on branch lams2_head_wildfly.

file patch00001_create_race_table.sql was initially added on branch lams2_head_wildfly.

file patch00001_patch01.sql was initially added on branch lams2_head_wildfly.

file patch00003_patch03.sql was initially added on branch lams2_head_wildfly.

file TestMigrationTaskInstantiationException.java was initially added on branch lams2_head_wildfly.

file sybase.properties was initially added on branch lams2_head_wildfly.

file sqlserver.properties was initially added on branch lams2_head_wildfly.

file postgres.properties was initially added on branch lams2_head_wildfly.

file oracle.properties was initially added on branch lams2_head_wildfly.

file mysql.properties was initially added on branch lams2_head_wildfly.

file hsqldb.properties was initially added on branch lams2_head_wildfly.

file FlatXmlDataSetTaskSource.java was initially added on branch lams2_head_wildfly.

file FlatXmlDataSetMigrationTask.java was initially added on branch lams2_head_wildfly.

file FileLoadingUtility.java was initially added on branch lams2_head_wildfly.