Describe the bug
After adding a couple migrations that use add_enum I can no longer run rake db:setup without the following error:
$ bundle exec rake db:setup
Database 'myapp_dev' already exists
Database 'myapp_test' already exists
rake aborted!
ActiveRecord::StatementInvalid: PG::DuplicateObject: ERROR: type "question_answer_length" already exists
/Users/emerson/Code/myapp/db/schema.rb:18:in `block in <main>'
/Users/emerson/Code/myapp/db/schema.rb:13:in `<main>'
/Users/emerson/.rbenv/versions/2.6.3/bin/bundle:23:in `load'
/Users/emerson/.rbenv/versions/2.6.3/bin/bundle:23:in `<main>'
Caused by:
PG::DuplicateObject: ERROR: type "question_answer_length" already exists
/Users/emerson/Code/myapp/db/schema.rb:18:in `block in <main>'
/Users/emerson/Code/myapp/db/schema.rb:13:in `<main>'
/Users/emerson/.rbenv/versions/2.6.3/bin/bundle:23:in `load'
/Users/emerson/.rbenv/versions/2.6.3/bin/bundle:23:in `<main>'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
To Reproduce
Steps to reproduce the behavior:
- Added
gem 'activerecord-postgres_enum' to Gemfile
$ bundle install
- Create a couple migrations that use
add_enum
- Run
$ bundle exec rake db:setup
Expected behavior
Command runs without error.
Context (please complete the following information):
- OS: MacOS
- Version 10.15.3
Additional context
Ruby version 2.6.3p62
PostgreSQL version 12
Describe the bug
After adding a couple migrations that use
add_enumI can no longer runrake db:setupwithout the following error:To Reproduce
Steps to reproduce the behavior:
gem 'activerecord-postgres_enum'to Gemfile$ bundle installadd_enum$ bundle exec rake db:setupExpected behavior
Command runs without error.
Context (please complete the following information):
Additional context
Ruby version 2.6.3p62
PostgreSQL version 12