Repository navigation
feat(cli): add named-migration subcommand for PostgreSQL backend - #47
Merged
Merged
Conversation
Registers the 'named-migration' CLI subcommand for the PostgreSQL backend. Delegates to the shared implementation in rhosocial.activerecord.backend.migration.cli. - cli/named_migration.py: parser + handler adapter - cli/__init__.py: register in COMMAND_NAMES and register_commands()
…ripts for PostgreSQL - Extend named_migration.py adapter with --async support (AsyncPostgresBackend) - Add extensive CLI epilog with 12 scenario examples and demo script references - Create examples/named_migrations/ with migrations.py, expressions.py, run_basic.py, run_chain.py - Add demo_basic.sh, demo_chain.sh, demo_all.sh end-to-end shell scripts - expressions.py uses PostgresSerialType and PostgresCharacterVaryingType
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev16 #47 +/- ##
========================================================
- Coverage 71.02% 70.90% -0.13%
========================================================
Files 276 277 +1
Lines 11253 11290 +37
Branches 1825 1828 +3
========================================================
+ Hits 7993 8005 +12
- Misses 2643 2668 +25
Partials 617 617
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ransaction demo scripts for PostgreSQL
…resCharacterVaryingType
|
8 of 12 tasks
vistart
added a commit
that referenced
this pull request
Aug 15, 2026
* feat(cli): add named-migration subcommand (PostgreSQL adapter) Registers the 'named-migration' CLI subcommand for the PostgreSQL backend. Delegates to the shared implementation in rhosocial.activerecord.backend.migration.cli. - cli/named_migration.py: parser + handler adapter - cli/__init__.py: register in COMMAND_NAMES and register_commands() * feat(migration): add --async support, example migrations, and demo scripts for PostgreSQL - Extend named_migration.py adapter with --async support (AsyncPostgresBackend) - Add extensive CLI epilog with 12 scenario examples and demo script references - Create examples/named_migrations/ with migrations.py, expressions.py, run_basic.py, run_chain.py - Add demo_basic.sh, demo_chain.sh, demo_all.sh end-to-end shell scripts - expressions.py uses PostgresSerialType and PostgresCharacterVaryingType * chore: add changelog fragment for PR #47 * chore: add parameterized migration, async, incompatible, and single-transaction demo scripts for PostgreSQL * fix(postgres): use positional arg instead of keyword 'size' for PostgresCharacterVaryingType * ci: trigger rebuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds the
named-migrationCLI subcommand to the PostgreSQL backend adapter, enabling PostgreSQL users to leverage the named migration system introduced in corepython-activerecord(PR #109).Changes:
cli/named_migration.py): Registersnamed-migrationsubcommand with PostgreSQL-specific connection config and delegates torhosocial.activerecord.backend.migration.cli.handle_named_migration. Supports both sync (PostgreSQLBackend) and async (AsyncPostgreSQLBackend) execution.examples/named_migrations/): PostgreSQL-specific migration examples:migrations.py:V001CreateUsers,V002CreatePosts,V003CreateCustomTableexpressions.py: DDL expressions with PostgreSQL data typesrun_basic.py/run_chain.py: Programmatic API usagedemo_basic.sh/demo_chain.sh/demo_all.sh: Shell demo scriptsType of change
feat: A new featureBreaking Change
Impact on End-Users:
No backward-incompatible changes. The
named-migrationsubcommand is a new addition.Impact on Backend Developers (Custom Implementations):
No backward-incompatible changes are expected for backend developers using custom implementations.
Related Repositories/Packages
Testing
Checklist
changelog.d/<pr_number>.added.mdAdditional Notes
This is the PostgreSQL plugin counterpart of the core migration feature (PR #109). The adapter is thin (~120 lines) — all core migration logic, dry-run validation, and record store management live in
rhosocial.activerecord.backend.migration.