INT-4262-4.3: Fix SQL scripts for IF EXISTS
JIRA: https://jira.spring.io/browse/INT-4262 Since `IF EXISTS` doesn't exist for `DROP INDEX` command and even more this command isn't necessary when we fully drop the table, we don't need it as a separate command. `DROP TABLE IF EXISTS` is fully sufficient for schema recreation requirements * Add `NODROPINDEX` variable for VPP engine to let it do not add `DROP INDEX` command * Fix `channel/schema-mysql.sql` for proper INDEX names
This commit is contained in:
committed by
Gary Russell
parent
b5c6158117
commit
ecc6824a8c
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE ;
|
||||
DROP TABLE INT_MESSAGE_GROUP ;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE ;
|
||||
DROP TABLE INT_MESSAGE_GROUP ;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE IF EXISTS;
|
||||
DROP TABLE INT_MESSAGE_GROUP IF EXISTS;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE IF EXISTS;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE IF EXISTS;
|
||||
DROP TABLE INT_MESSAGE_GROUP IF EXISTS;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE IF EXISTS;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
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 INDEX IF EXISTS INT_MESSAGE_IX1 ;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
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 INDEX IF EXISTS INT_MESSAGE_IX1 ;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE ;
|
||||
DROP TABLE INT_MESSAGE_GROUP ;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE ;
|
||||
DROP TABLE INT_MESSAGE_GROUP ;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE ;
|
||||
DROP TABLE INT_MESSAGE_GROUP ;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
DROP TABLE INT_MESSAGE ;
|
||||
DROP TABLE INT_MESSAGE_GROUP ;
|
||||
DROP TABLE INT_GROUP_TO_MESSAGE ;
|
||||
|
||||
@@ -10,7 +10,7 @@ CREATE TABLE INT_CHANNEL_MESSAGE (
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
ALTER TABLE INT_CHANNEL_MESSAGE
|
||||
ADD INDEX MSG_INDEX_DATE_IDX USING BTREE (CREATED_DATE, MESSAGE_SEQUENCE);
|
||||
ADD INDEX INT_CHANNEL_MSG_DATE_IDX USING BTREE (CREATED_DATE, MESSAGE_SEQUENCE);
|
||||
|
||||
ALTER TABLE INT_CHANNEL_MESSAGE
|
||||
ADD INDEX MSG_INDEX_PRIORITY_IDX USING BTREE (MESSAGE_PRIORITY DESC, CREATED_DATE, MESSAGE_SEQUENCE);
|
||||
ADD INDEX INT_CHANNEL_MSG_PRIORITY_IDX USING BTREE (MESSAGE_PRIORITY DESC, CREATED_DATE, MESSAGE_SEQUENCE);
|
||||
|
||||
@@ -2,4 +2,5 @@ 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 INDEX $!{IFEXISTSBEFORE} INT_MESSAGE_IX1 $!{IFEXISTS};
|
||||
#if(!${NODROPINDEX})DROP INDEX $!{IFEXISTSBEFORE} INT_MESSAGE_IX1 $!{IFEXISTS};#end
|
||||
|
||||
|
||||
@@ -12,3 +12,4 @@ TIMESTAMP = DATETIME(6)
|
||||
VARCHAR = VARCHAR
|
||||
# for generating drop statements...
|
||||
SEQUENCE = TABLE
|
||||
NODROPINDEX = true
|
||||
@@ -12,3 +12,4 @@ TIMESTAMP = DATETIME
|
||||
VARCHAR = VARCHAR
|
||||
# for generating drop statements...
|
||||
SEQUENCE = TABLE
|
||||
NODROPINDEX = true
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user