Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop script for Postgresql assumes that the tables are there when dropping constraints. [BATCH-2022] #1570

Closed
spring-issuemaster opened this issue May 3, 2013 · 5 comments
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 3, 2013

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 6, 2013

Wayne Lund commented

Validated that it breaks in a greenfield where there is no existing database yet or tables haven't been created.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 6, 2013

Wayne Lund commented

Got carried away with drop constraints because of work on another database that required it at one point. I've tested now without the drop constraint and it works just fine now. I left in the "if exists" as they are helpful in avoiding the false errors when its greenfield.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 7, 2013

Dave Syer commented

I think that "IF EXISTS" is dialect dependent, so we originally took the view that it is better to have the drop statements than not if that idiom is not available on a given platform. If you use jdbc:initialize-database/ you can add ignore-failures="DROPS" so it's easy to work around the difference.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 7, 2013

Michael Minella commented

@Dave, The issue for the Postgres query was that there were drops for constraints added before the drops for the tables. The attempts for dropping constraints on a table that didn't exist was throwing an error when batch admin started with the default settings. Wayne issued a PR that will remove the drops for constraints (which were unnecessary anyways) solving the issue.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 7, 2013

Dave Syer commented

I see (should have looked at the pull request I suppose).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.