Open
Description
Greetings.
I'm using rails 7.0.4 and I accidentally removed my production sqlite3 file. Since I used yaml_db
in order to keep a dump for my database, I reminded of the file and tried to recover it.
For some obvious reasons, we've decided to move our code base to postgresql and when I set everything up, it works fine. So, when I run rails db:data:load
command, I get this error:
rails aborted!
ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: insert or update on table "credit_packs" violates foreign key constraint "fk_rails_21f35c4567"
DETAIL: Key (user_id)=(1) is not present in table "users".
Caused by:
PG::ForeignKeyViolation: ERROR: insert or update on table "credit_packs" violates foreign key constraint "fk_rails_21f35c4567"
DETAIL: Key (user_id)=(1) is not present in table "users".
Tasks: TOP => db:data:load
(See full trace by running task with --trace)
What should I do now?
Explanation about the credit_pack
model : It's something which every user has. So I don't know why this dataloader thingy tries to first create them then users.
Metadata
Metadata
Assignees
Labels
No labels
Activity