Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with data:migrate:down Rake-task #14

Open
andrykonchin opened this issue Feb 17, 2022 · 2 comments
Open

Issue with data:migrate:down Rake-task #14

andrykonchin opened this issue Feb 17, 2022 · 2 comments

Comments

@andrykonchin
Copy link

Hi, I have noticed that there is a problem with rolling back a data migration.

Scenario:

  • create a migration
  • run it
  • rolled back with the command rake data:migrate:down VERSION=...
  • run it again with the command rake data:migrate:up VERSION=

Expected result - a migration is applied without errors
Actual result - a migration is applied but it fails with error SQLite3::ConstraintException: UNIQUE constraint failed: data_migrations.version.

As far as I understand Rake-task data:migrate:down should remove a version of the rolled-back migration in the data_migrations table. But it doesn't. That's why when this migration is applied again and data:migrate:up tries to add a new row in the data_migrations table - conflicts with the unique constraint and fails.

@xhuberdeau
Copy link

Hi,

I've got the same problem there.

@andrykonchin, did you find a solution to your issue?

@andrykonchin
Copy link
Author

Nope. The only solution is to fix the bug. It looks trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants