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

Squash migrations #2268

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Squash migrations #2268

wants to merge 2 commits into from

Conversation

thenav56
Copy link
Member

@thenav56 thenav56 commented Sep 18, 2024

Addresses

Changes

  • Squash migrations

Problems

  • Handle missing migrations (./manage.py migrate)
  • Handle custom RunPython code. Mostly involving data ingestion
    • SKIP api/migrations/0077_auto_20200721_1051.py (Updates existing data)
      • Changes FieldReport with District(id=3525) to District(id=1234)
    • CHECK api/migrations/0084_region_label.py (Updates existings data)
      • Updates Region Label
    • CHECK api/migrations/0101_uppercase_iso.py (Updates existings data)
      • Uppercase Country(iso & iso3) and District(country_iso)
    • CHECK api/migrations/0188_auto_20231130_0900.py
      • Creates DisasterType using event_type_map
      • Updates all GDACSEvent using that map
    • SKIP api/migrations/0211_alter_countrydirectory_unique_together_and_more.py (Deletes existing data)
    • SKIP api/migrations/0212_alter_countrycapacitystrengthening_unique_together.py (Deletes existing data)
    • SKIP api/migrations/0212_profile_limit_access_to_guest.py (Set limit_access_to_guest=false for existing users)
    • SKIP deployments/migrations/0024_migrate_project_districts_to_new_field_20200513_1126.py (Migrate FK data to M2M)
    • SKIP deployments/migrations/0026_sector_health_merge.py (Enum data migrate for existing projects)
    • SKIP deployments/migrations/0030_actual_expenditure_complete_project.py (Update field value for existing projects)
    • SKIP deployments/migrations/0038_auto_20210820_0733.py (Not used)
    • SKIP deployments/migrations/0039_auto_20210823_1159.py (Update existing project fields)
    • SKIP dref/migrations/0058_auto_20230529_0806.py (Update existing rows columns)
    • SKIP dref/migrations/0062_auto_20230619_0931.py (Update existing rows columns)
    • SKIP dref/migrations/0073_auto_20231214_0358.py (Enum data migrate)
    • SKIP notifications/migrations/0012_surgealert_is_stood_down.py (Update existing rows column)
    • CHECK per/migrations/0086_migrate_old_form.py
      • Nest data generated using Form
      • Need zoltan review for the forwards_func logic
    • SKIP per/migrations/0087_update_phase.py (Update Overview phase value)
    • SKIP per/migrations/0088_update_assessment_method.py (Enum data migrate)
    • CHECK per/migrations/0090_auto_20231030_1505.py
      • Add hard-coded FormAnswer to FormQuestion
    • SKIP per/migrations/0094_update_supported_by_organization_type.py (Updates PerWorkPlanComponent supported_by_organization_type)
    • SKIP per/migrations/0096_migrate_formdata_notes.py (Nothing here)
    • CHECK per/migrations/0098_auto_20240118_0552.py
      • Imperative FormComponent Changes
    • SKIP per/migrations/0098_fix_reversion_data_20240208_0502.py (Reversion data fix)
    • CHECK per/migrations/0099_migrate_notes.py
      • Imperative FormComponentResponse Changes
    • CHECK per/migrations/0100_auto_20240130_0851.py
      • Imperative Data generation
    • TODO per/migrations/0100_migrate_all_notes.py
    • TODO per/migrations/0106_auto_20240314_1059.py
    • TODO per/migrations/0108_auto_20240320_0801.py
    • TODO per/migrations/0109_auto_20240320_0804.py
    • TODO per/migrations/0110_auto_20240325_0611.py
    • TODO per/migrations/0112_auto_20240426_0522.py

Post actions

  • Deploy to staging (Run migrate)
  • Deploy to production (Run migrate)
  • Deleting all the migration files it replaces.
  • Updating all migrations that depend on the deleted migrations to depend on the squashed migration instead.
  • Removing the replaces attribute in the Migration class of the squashed migration (this is how Django tells that it is a squashed migration).

Related notes: https://notes.tools.togglecorp.com/QIubF6JuRzC1o4iggl8b5w

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