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

[Bug]: Migrations seem not to be applying data to database in during make up #15153

Open
1 task done
KevinMind opened this issue Nov 8, 2024 · 3 comments · May be fixed by mozilla/addons-server#22860
Open
1 task done

Comments

@KevinMind
Copy link
Contributor

KevinMind commented Nov 8, 2024

What happened?

When you run make up we should:

  • get the database migrated
  • optionally seed the database if it is empty or you are cleaning it

It seems that after runnning make up in various scenarios, migrations are successfully ran but data introduced in migraitons (Licenses, WaffleFlag/Switch) are not in the DB state.

What did you expect to happen?

Any data that is generated during a migration should be present in the database after running make up. No data added via a migration should be removed automatically at any point.

Is there an existing issue for this?

  • I have searched the existing issues

┆Issue is synchronized with this Jira Task

@KevinMind
Copy link
Contributor Author

@diox I wonder if the problem is that we are running migrate 2 times... we run it on initialize and then if data_seed is called we flush and run again... maybe flush doesn't remove the migration table rows and so when we run migrate the second time.. nothing happens.

I think "flush" is not strong enough for us in general seems kind of shaky. but need to investigate further.

@diox
Copy link
Member

diox commented Nov 8, 2024

But the schema is already correct when we reach the seed step, so if the migrations table was empty, migrate would try to apply migrations from the beginning, and fail...

Ultimately I think any data migration we have should be added somehow to the initial data seed.

@KevinMind
Copy link
Contributor Author

@bakulf and I debugged a scneario and it could be the case that when running migration the first time we get the new data and then run "flush" and when we run the migration again it won't be applied because it already has been run.

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

Successfully merging a pull request may close this issue.

3 participants