exception_handler
exception_handler copied to clipboard
Migration tries to recreate table if it already exists
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
- run
rails db:migrateto create the errors table and update schema.rb - run
rails db:resetto reset the database as per the schema file - run
rails db:migrateagain 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
Thanks for the comment, will investigate