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

Skip initial migration if seeding on initialize.py #22860

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KevinMind
Copy link
Contributor

Fixes: mozilla/addons#15153

Description

Makes sure if we are going to run data_seed in the initialize command that we do not pre migrate the database as this could lead to data being dropped post migration

Context

When running make up initialize will 1) migrate the db 2) seed the db if necessary and the second step also runs migrate, but after flushing the db.

This can lead to a scenario where the database migrates data and then removes it, and the second migration does not reintroduce the data.

Testing

  • have a migration that modifies the database
  • run this command

WARNING: this will wipe your current database state.

make up INIT_CLEAN=True
  • expect that the data applied from your migration is in the database

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind marked this pull request as draft November 15, 2024 15:31
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

Successfully merging this pull request may close these issues.

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