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

Migration tries to recreate table if it already exists #49

Open
davidhajje opened this issue May 11, 2017 · 1 comment
Open

Migration tries to recreate table if it already exists #49

davidhajje opened this issue May 11, 2017 · 1 comment

Comments

@davidhajje
Copy link

As per the documentation, for ActiveRecord integration, all that is required is to run rails db:migrate This also adds the errors table in to the schema.rb file.

The problem is then whenever anyone calls rails db:reset it gets the database configuration from the schema.rb and creates the errors table.

When db:migrate is used again (such as to complete a later migration), it tries to create the errors table again throwing a duplicate table error.

Steps to reproduce

  1. run rails db:migrate to create the errors table and update schema.rb
  2. run rails db:reset to reset the database as per the schema file
  3. run rails db:migrate again to get the exception handler gem to try and recreate the table again

Expected behaviour

Exception handler should know that a table with the same name (and/or same columns) already exists and not try to recreate the table

Actual behaviour

Exception handler tries to recreate the errors table

System Configuration

Ruby 2.2.4
Rails 5.0.1
PostgreSQL 9.5.4

@richpeck
Copy link
Owner

Thanks for the comment, will investigate

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

No branches or pull requests

2 participants