Search code examples
ruby-on-railspostgresqlcapistranorails-postgresql

Getting PG duplicate table error on deploy


I want to deploy from a branch in which I have three new migration files.

However, on deploy, I get an error.

This is the log output:

DEBUG [50e68bc0]    ==  CreateLimitGroups: migrating 
==============================================
DEBUG [50e68bc0]    -- create_table(:limit_groups)
DEBUG [50e68bc0]    rake aborted!
DEBUG [50e68bc0]    An error has occurred, this and all later migrations canceled:
DEBUG [50e68bc0]    
DEBUG [50e68bc0]    PG::DuplicateTable: ERROR:  relation "limit_groups" already exists

Why is this happening? Could be from a schema version conflict?


Solution

  • This message means that you already have this table. You can delete it manyally in postgresql menu.

    Just be sure that this table is empty.