Skip to content

Fix profiling migration defaults for large MySQL upgrades#123

Merged
vishalanandl177 merged 2 commits into
mainfrom
codex/fix-issue-121-mysql-migration
May 23, 2026
Merged

Fix profiling migration defaults for large MySQL upgrades#123
vishalanandl177 merged 2 commits into
mainfrom
codex/fix-issue-121-mysql-migration

Conversation

@vishalanandl177
Copy link
Copy Markdown
Owner

@vishalanandl177 vishalanandl177 commented May 23, 2026

Summary

  • remove default=None from the existing 0003_apilogsmodel_profiling migration and matching model fields while keeping them nullable/blankable
  • align historical migration state metadata so makemigrations --check --dry-run stays clean without creating a new migration
  • document the 1.2.0+ profiling-column upgrade risk for large MySQL/MariaDB tables, including sqlmigrate, online DDL planning, and fake-apply guidance
  • add a regression test that verifies profiling fields remain nullable without Python-level defaults
  • bump package/docs version markers to 1.2.2

Closes #121

Validation

  • git diff --check
  • rg -n "default=None" drf_api_logger\migrations\0003_apilogsmodel_profiling.py drf_api_logger\models.py returned no matches
  • J:\projects\drf-demo\venv\Scripts\python.exe -m django test tests --settings=tests.test_settings --verbosity=1 -> 143 tests passed
  • J:\projects\drf-demo\venv\Scripts\python.exe -m django makemigrations drf_api_logger --check --dry-run --settings=tests.test_settings -> no changes detected
  • J:\projects\drf-demo\venv\Scripts\python.exe -m django sqlmigrate drf_api_logger 0003 --settings=tests.test_settings -> nullable column additions with no defaults
  • J:\projects\drf-demo\venv\Scripts\python.exe -m django migrate drf_api_logger --plan --settings=tests.test_settings
  • C:\Users\ALKETRON\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe setup.py --version -> 1.2.2

@vishalanandl177 vishalanandl177 merged commit d2c0af8 into main May 23, 2026
2 checks passed
@vishalanandl177 vishalanandl177 deleted the codex/fix-issue-121-mysql-migration branch May 23, 2026 18:02
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.

Migration 0003_apilogsmodel_profiling can cause downtime or fail on large tables (MySQL/MariaDB)

1 participant