You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MPT-16844: add --new-data and --new-schema options to migrate command (#10)
Fist iteration adding --new-data and --new-schema options
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Closes [MPT-16844](https://softwareone.atlassian.net/browse/MPT-16844)
- Add migrate CLI options --new-data and --new-schema (mutually
exclusive) to scaffold timestamped migration files
- When option provided: determine suffix, ensure migrations folder
exists, create timestamped Python file using
MIGRATION_SCAFFOLDING_TEMPLATE, abort on name collisions, and print
success
- When no option provided: print "Running migrations is not implemented
yet."
- Select scaffold base class by option: DataBaseCommand for data
migrations, SchemaBaseCommand for schema migrations
- Introduce BaseCommand ABC and specialized DataBaseCommand /
SchemaBaseCommand; add MigrationTypeEnum (DATA, SCHEMA); re-export
commands from mpt_tool.commands
- Add MIGRATION_FOLDER constant and MIGRATION_SCAFFOLDING_TEMPLATE (and
template text) in mpt_tool.templates.py
- Tests: add CWD fixture, CLI help, mutual-exclusion validation,
time-frozen parameterized tests for --new-data/--new-schema, scaffold
file creation and collision handling, and BaseCommand subclass checks
- Tooling/CI updates: add freezegun to dev deps; adjust coverage,
flake8, ruff, and pre-commit settings; small Dockerfile and sonar config
tweaks
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
[MPT-16844]:
https://softwareone.atlassian.net/browse/MPT-16844?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
0 commit comments