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

Practice script: set Reg1 operation statuses to "Draft" #2900

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

andrea-williams
Copy link
Contributor

@andrea-williams andrea-williams commented Feb 25, 2025

Card: #2770

How to Test/Run:

  1. If the script file you're testing is in a /migrations folder, move it to some other folder so that it won't be automatically included in check_migrations_with_prod_data
  2. Follow the steps listed in bc_obps/common/management/commands/check_migrations_with_prod_data.py (regarding making changes to your local bc_obps/.env file.
  3. You'll also need to comment out lines 73-74 and 80-81 in check_migrations_with_prod_data, so that you can retain a copy of the prod data locally while you test.
  4. Sign in to Openshift with the CLI tool
  5. Run poetry run python manage.py check_migrations_with_prod_data --pod <pod_name>, where pod_name is the name of a postgres pod in our Openshift PROD env
  6. Once you've successfully pulled the prod data into your local "obps" database, run poetry run python manage.py migrate reporting to apply all Django migrations except for the migration included in this PR. The poetry run python manage.py showmigrations command is also useful for seeing which migrations have been applied.
  7. Move the script file you're testing back into the appropriate /migrations folder.
  8. Now run poetry run python manage.py migrate registration, which will run the migration included in this PR. You'll be able to see the print statements describing what data was affected by the latest migration.

For testing purposes, the migration in this PR contains assertions and print statements for testing purposes and to demonstrate that the migration is working as expected. These assertions and print statements will be deleted from the migration before merging (it's also why the pre-commit hook is failing).

REMEMBER TO DELETE YOUR LOCAL COPY OF THE PROD DATA ONCE YOU'VE FINISHED TESTING!

…pt for Declined operations which get archived
@andrea-williams andrea-williams force-pushed the task/migrate-operation-statuses-reg1/2770 branch from 7607759 to 95b3f55 Compare February 25, 2025 17:33
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.

1 participant