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

Fix for postgres driver blindly recreating the migrations table #89

Merged
merged 1 commit into from Apr 18, 2013

Conversation

sgibbons
Copy link
Contributor

Despite this ticket: #20 being marked as closed, I'm still experiencing this problem with the latest version.

As it exists now, the createMigrationsTable function in the pg driver has ifNotExists: false, which I assume is because pg doesn't support IF NOT EXISTS create statements. This results in the migrations table getting recreated each time the migrations are run, which results in a crash after the first run.

This change fixes the issue by querying the information_schema.tables table to check for the existence of a migrations table. If it exists, the creation of the table is skipped.

…f whether or not it's already been created - this change to the driver first checks the information schema for the existence of the table and does/doesn't create it accordingly
kunklejr added a commit that referenced this pull request Apr 18, 2013
Fix for postgres driver blindly recreating the migrations table
@kunklejr kunklejr merged commit 545b706 into db-migrate:master Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants