Issue Details (XML | Word | Printable)

Key: BATCH-690
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Thomas Risberg
Reporter: Thomas Risberg
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Spring Batch

Move drop table statements to separate script

Created: 26/Jun/08 09:13 PM   Updated: 17/Jul/08 06:55 AM
Component/s: Core
Affects Version/s: None
Fix Version/s: 2.0.0.RC1

Time Tracking:
Original Estimate: 0.25d
Original Estimate - 0.25d
Remaining Estimate: 0.25d
Remaining Estimate - 0.25d
Time Spent: Not Specified
Remaining Estimate - 0.25d


 Description  « Hide
The drop table statements generate errors when running the schema scripts in a new database. The drop table statements could be in a separate script and run when needed.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Dave Syer added a comment - 27/Jun/08 02:45 AM
Some platforms allow you to skip a drop if the table doesn't exist. Anyway this is a perfectly reasonable suggestion. I think the reason they are in the same script is historical (the InitializingDataSourceFactoryBean that we used to use had only one script to run at startup). To be sure we do not inadvertently break tests (environment specific ordering can catch you out) we should change all the tests configs to include the new drop script in the initScripts, preserving the current behaviour. Errors on drop are ignored by default in the factory bean by default so all the tests should still work on any platform.

Thomas Risberg added a comment - 27/Jun/08 08:07 AM
In order to maintain the current scripts we could simply provide two additional scripts per platform - schema-create-xxx.sql and xhema-drop-xxx.sql containing the create and drop statements respectively. The schema-xxx.sql could still be provided with both drop and create statements.

Dave Syer added a comment - 27/Jun/08 08:27 AM
Let's not go overboard (three scripts per platform seems too much to me). The existing behaviour can be retained just by adding the (new) drop script to the list of initScripts in the initialising data source.

Dave Syer added a comment - 27/Jun/08 08:38 AM
I also think to avoid confusion it would be better to retain the old names for the create files (and add a drop-xxx.sql).