diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-db2.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-db2.sql index 55c72d9705..6805ae91d3 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-db2.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-db2.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP ; DROP TABLE INT_GROUP_TO_MESSAGE ; DROP TABLE INT_LOCK ; DROP TABLE INT_CHANNEL_MESSAGE ; - DROP SEQUENCE INT_MESSAGE_SEQ ; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ ; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-derby.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-derby.sql index 1740fb9565..d49ada18b6 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-derby.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-derby.sql @@ -8,3 +8,4 @@ DROP TABLE INT_MESSAGE_GROUP ; DROP TABLE INT_GROUP_TO_MESSAGE ; DROP TABLE INT_LOCK ; DROP TABLE INT_CHANNEL_MESSAGE ; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-h2.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-h2.sql index 940b7391e5..8725447fe2 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-h2.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-h2.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP IF EXISTS; DROP TABLE INT_GROUP_TO_MESSAGE IF EXISTS; DROP TABLE INT_LOCK IF EXISTS; DROP TABLE INT_CHANNEL_MESSAGE IF EXISTS; - DROP SEQUENCE INT_MESSAGE_SEQ IF EXISTS; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ IF EXISTS; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-hsqldb.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-hsqldb.sql index 940b7391e5..8725447fe2 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-hsqldb.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-hsqldb.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP IF EXISTS; DROP TABLE INT_GROUP_TO_MESSAGE IF EXISTS; DROP TABLE INT_LOCK IF EXISTS; DROP TABLE INT_CHANNEL_MESSAGE IF EXISTS; - DROP SEQUENCE INT_MESSAGE_SEQ IF EXISTS; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ IF EXISTS; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-mysql.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-mysql.sql index 4d9ec5fcd3..35858e3de6 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-mysql.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-mysql.sql @@ -1,10 +1,8 @@ -- Autogenerated: do not edit this file -DROP INDEX IF EXISTS INT_MESSAGE_IX1 ; -DROP INDEX IF EXISTS INT_CHANNEL_MSG_DATE_IDX ; -DROP INDEX IF EXISTS INT_CHANNEL_MSG_PRIORITY_IDX ; DROP TABLE IF EXISTS INT_MESSAGE ; DROP TABLE IF EXISTS INT_MESSAGE_GROUP ; DROP TABLE IF EXISTS INT_GROUP_TO_MESSAGE ; DROP TABLE IF EXISTS INT_LOCK ; DROP TABLE IF EXISTS INT_CHANNEL_MESSAGE ; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-oracle.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-oracle.sql index 55c72d9705..6805ae91d3 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-oracle.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-oracle.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP ; DROP TABLE INT_GROUP_TO_MESSAGE ; DROP TABLE INT_LOCK ; DROP TABLE INT_CHANNEL_MESSAGE ; - DROP SEQUENCE INT_MESSAGE_SEQ ; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ ; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-postgresql.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-postgresql.sql index 55c72d9705..6805ae91d3 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-postgresql.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-postgresql.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP ; DROP TABLE INT_GROUP_TO_MESSAGE ; DROP TABLE INT_LOCK ; DROP TABLE INT_CHANNEL_MESSAGE ; - DROP SEQUENCE INT_MESSAGE_SEQ ; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ ; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sqlserver.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sqlserver.sql index 55c72d9705..6805ae91d3 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sqlserver.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sqlserver.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP ; DROP TABLE INT_GROUP_TO_MESSAGE ; DROP TABLE INT_LOCK ; DROP TABLE INT_CHANNEL_MESSAGE ; - DROP SEQUENCE INT_MESSAGE_SEQ ; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ ; + diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sybase.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sybase.sql index 55c72d9705..6805ae91d3 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sybase.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-sybase.sql @@ -8,4 +8,5 @@ DROP TABLE INT_MESSAGE_GROUP ; DROP TABLE INT_GROUP_TO_MESSAGE ; DROP TABLE INT_LOCK ; DROP TABLE INT_CHANNEL_MESSAGE ; - DROP SEQUENCE INT_MESSAGE_SEQ ; \ No newline at end of file +DROP SEQUENCE INT_MESSAGE_SEQ ; + diff --git a/spring-integration-jdbc/src/main/sql/destroy.sql.vpp b/spring-integration-jdbc/src/main/sql/destroy.sql.vpp index 1d8f750d10..8fa27afe22 100644 --- a/spring-integration-jdbc/src/main/sql/destroy.sql.vpp +++ b/spring-integration-jdbc/src/main/sql/destroy.sql.vpp @@ -1,9 +1,18 @@ +#if(!${NODROPINDEX}) DROP INDEX $!{IFEXISTSBEFORE} INT_MESSAGE_IX1 $!{IFEXISTS}; +#end +#if(!${NODROPINDEX}) DROP INDEX $!{IFEXISTSBEFORE} INT_CHANNEL_MSG_DATE_IDX $!{IFEXISTS}; +#end +#if(!${NODROPINDEX}) DROP INDEX $!{IFEXISTSBEFORE} INT_CHANNEL_MSG_PRIORITY_IDX $!{IFEXISTS}; +#end DROP TABLE $!{IFEXISTSBEFORE} INT_MESSAGE $!{IFEXISTS}; DROP TABLE $!{IFEXISTSBEFORE} INT_MESSAGE_GROUP $!{IFEXISTS}; DROP TABLE $!{IFEXISTSBEFORE} INT_GROUP_TO_MESSAGE $!{IFEXISTS}; DROP TABLE $!{IFEXISTSBEFORE} INT_LOCK $!{IFEXISTS}; DROP TABLE $!{IFEXISTSBEFORE} INT_CHANNEL_MESSAGE $!{IFEXISTS}; -#if(${INT_MESSAGE_SEQ}) DROP SEQUENCE INT_MESSAGE_SEQ $!{IFEXISTS};#end +#if(${INT_MESSAGE_SEQ}) +DROP SEQUENCE INT_MESSAGE_SEQ $!{IFEXISTS}; +#end + diff --git a/spring-integration-jdbc/src/main/sql/mysql.properties b/spring-integration-jdbc/src/main/sql/mysql.properties index 1b18e55577..36b17d606e 100644 --- a/spring-integration-jdbc/src/main/sql/mysql.properties +++ b/spring-integration-jdbc/src/main/sql/mysql.properties @@ -12,4 +12,5 @@ TIMESTAMP = DATETIME(6) VARCHAR = VARCHAR # for generating drop statements... SEQUENCE = TABLE -AUTO_INCREMENT = AUTO_INCREMENT UNIQUE \ No newline at end of file +AUTO_INCREMENT = AUTO_INCREMENT UNIQUE +NODROPINDEX = true diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java index c2b0b0b18b..143c388562 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java @@ -72,6 +72,7 @@ public class DelayerHandlerRescheduleIntegrationTests { public static void init() { dataSource = new EmbeddedDatabaseBuilder() .setType(EmbeddedDatabaseType.H2) + .addScript("classpath:/org/springframework/integration/jdbc/schema-drop-h2.sql") .addScript("classpath:/org/springframework/integration/jdbc/schema-h2.sql") .build(); }