简体   繁体   中英

Ruby on Rails - Sometimes the column exists, sometimes it doesn't. Is it related to this Postgres error when I dump the Database

How to correct the following errors when a load my production database into the developement?

´´´ ERROR: relation "ar_internal_metadata" already exists ERROR: relation "envelopes" already exists ERROR: relation "envelopes_id_seq" already exists ERROR: relation "registers" already exists ERROR: relation "registers_id_seq" already exists ERROR: relation "schema_migrations" already exists ERROR: relation "signers" already exists ERROR: relation "signers_id_seq" already exists ERROR: relation "tenants" already exists ERROR: relation "tenants_id_seq" already exists ERROR: duplicate key value violates unique constraint "ar_internal_metadata_pkey" DETAIL: Key (key)=(environment) already exists. CONTEXT: COPY ar_internal_metadata, line 1 ERROR: duplicate key value violates unique constraint "schema_migrations_pkey" DETAIL: Key (version)=(20170523182814) already exists. CONTEXT: COPY schema_migrations, line 1 ERROR: multiple primary keys for table "ar_internal_metadata" are not allowed ERROR: multiple primary keys for table "envelopes" are not allowed ERROR: multiple primary keys for table "registers" are not allowed ERROR: multiple primary keys for table "schema_migrations" are not allowed ERROR: multiple primary keys for table "signers" are not allowed ERROR: multiple primary keys for table "tenants" are not allowed ERROR: relation "index_envelopes_on_creator_id" already exists ERROR: relation "index_registers_on_creator_id" already exists ERROR: relation "index_registers_on_envelope_id" already exists ERROR: relation "index_signers_on_creator_id" already exists ERROR: relation "index_signers_on_envelope_id" already exists ERROR: constraint "fk_rails_60f86fe8da" for relation "registers" already exists

Could you give more details please?

My guess is that you did:

$ rails db:drop

Then

@ rails db:create    
$ rails db:migrate

Then you got that error

Could you confirm by editing your original message. Thx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM