From f056a1136fcbecf7cc23a497b241924ed72be32b Mon Sep 17 00:00:00 2001 From: Wayne Lund Date: Tue, 12 Feb 2013 23:14:21 -0800 Subject: [PATCH] Failed to add all of the files in the previous commit. These are the other additional changes made. --- spring-batch-core/pom.xml | 16 +++++++++++++++- .../batch/core/schema-drop-postgresql.sql | 6 ++++++ .../src/main/sql/postgresql.properties | 1 + spring-batch-core/src/main/sql/postgresql.vpp | 2 ++ .../src/main/sql/schema-drop.sql.vpp | 4 +++- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/pom.xml b/spring-batch-core/pom.xml index 27dcc5d88..5593f2061 100644 --- a/spring-batch-core/pom.xml +++ b/spring-batch-core/pom.xml @@ -188,8 +188,22 @@ - + + + + + + + + + + + + + + + diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-drop-postgresql.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-drop-postgresql.sql index b8bfceeaa..3be649d76 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-drop-postgresql.sql +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-drop-postgresql.sql @@ -1,4 +1,10 @@ -- Autogenerated: do not edit this file +ALTER TABLE BATCH_JOB_INSTANCE DROP CONSTRAINT IF EXISTS JOB_INST_UN; +ALTER TABLE BATCH_JOB_EXECUTION DROP CONSTRAINT IF EXISTS JOB_INST_EXEC_FK; +ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP CONSTRAINT IF EXISTS JOB_EXEC_PARAMS_FK; +ALTER TABLE BATCH_STEP_EXECUTION DROP CONSTRAINT IF EXISTS JOB_EXEC_STEP_FK; +ALTER TABLE BATCH_STEP_EXECUTION_CONTEXT DROP CONSTRAINT IF EXISTS STEP_EXEC_CTX_FK; +ALTER TABLE BATCH_JOB_EXECUTION_CONTEXT DROP CONSTRAINT IF EXISTS JOB_EXEC_CTX_FK; DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_CONTEXT CASCADE; DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_CONTEXT CASCADE; diff --git a/spring-batch-core/src/main/sql/postgresql.properties b/spring-batch-core/src/main/sql/postgresql.properties index f2b744e1a..15041c2a5 100644 --- a/spring-batch-core/src/main/sql/postgresql.properties +++ b/spring-batch-core/src/main/sql/postgresql.properties @@ -4,6 +4,7 @@ BIGINT = BIGINT IDENTITY = GENERATED = IFEXISTSBEFORE = IF EXISTS +DROPCONSTRAINT = TRUE DOUBLE = DOUBLE PRECISION BLOB = BYTEA CLOB = TEXT diff --git a/spring-batch-core/src/main/sql/postgresql.vpp b/spring-batch-core/src/main/sql/postgresql.vpp index 59986a65a..3d0eebaf6 100644 --- a/spring-batch-core/src/main/sql/postgresql.vpp +++ b/spring-batch-core/src/main/sql/postgresql.vpp @@ -1,3 +1,5 @@ +#macro (alter $name $table $constraint) ALTER TABLE ${name} DROP CONSTRAINT IF EXISTS ${constraint}; +#end #macro (sequence $name $value)CREATE SEQUENCE ${name} MAXVALUE 9223372036854775807 NO CYCLE; #end #macro (notnull $name $type)ALTER COLUMN ${name} SET NOT NULL#end diff --git a/spring-batch-core/src/main/sql/schema-drop.sql.vpp b/spring-batch-core/src/main/sql/schema-drop.sql.vpp index 36da3d815..33650f0a3 100644 --- a/spring-batch-core/src/main/sql/schema-drop.sql.vpp +++ b/spring-batch-core/src/main/sql/schema-drop.sql.vpp @@ -1,3 +1,5 @@ -- Autogenerated: do not edit this file - +## Done so that we didn't have to modify all of the other files besides postgresql +#if (!$DROPCONSTRAINT) #set($DROPCONSTRAINT = "FALSE") #end +#if ( $DROPCONSTRAINT == "TRUE") #parse("${includes}/drop.constraints.sql.vpp") #end #parse("${includes}/destroy.sql.vpp")