Skip to content

fix: changed migration script#52

Merged
Alam-2U merged 1 commit into
release-ulmofrom
ealam/migration_script_changes
May 19, 2026
Merged

fix: changed migration script#52
Alam-2U merged 1 commit into
release-ulmofrom
ealam/migration_script_changes

Conversation

@Alam-2U
Copy link
Copy Markdown
Collaborator

@Alam-2U Alam-2U commented May 19, 2026

Description

During MongoDB → MySQL migration validation in stage, multiple data consistency issues were identified. This PR updates the migration scripts for production and adds backfill commands to correct the affected stage data.

Changes Included

  • Fixed created_at and updated_at fields in forum/backends/mysql/models.py to use default=timezone.now instead of auto_now_add=True / auto_now=True, preventing original timestamps from being overwritten during migration.

  • Added missing closed_by and reason fields to the migration script so the data is migrated correctly from MongoDB to MySQL.

  • Added backfill support for author_username for older migrated records where the field remained NULL because the column was introduced after the initial July/October migrations.

  • Added commands/scripts to backfill all three issues in the stage environment before production rollout.

Tickets

COSMO2-923
COSMO2-925
COSMO2-936

@Alam-2U Alam-2U force-pushed the ealam/migration_script_changes branch from 1cdb141 to c884ced Compare May 19, 2026 09:36
@Alam-2U Alam-2U marked this pull request as ready for review May 19, 2026 09:45
@Alam-2U Alam-2U merged commit 52994ac into release-ulmo May 19, 2026
13 checks passed
@Alam-2U Alam-2U deleted the ealam/migration_script_changes branch May 19, 2026 11:49
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.

2 participants