Skip to content

Add 'om migrate stamp' command to mark migrations as applied #774

@abrookins

Description

@abrookins

Summary

Add om migrate stamp command to mark migrations as applied without actually running them.

Use Cases

  1. Importing existing schema: When adopting Redis OM on an existing database where indexes already exist
  2. Manual migrations: When you've manually applied schema changes and need to update tracking
  3. CI/CD workflows: Mark specific migration states for testing or deployment

Proposed Interface

# Mark all pending migrations as applied
om migrate stamp --all

# Mark specific migration as applied
om migrate stamp <migration_id>

# Mark up to a specific migration
om migrate stamp --target <migration_id>

Implementation Notes

  • Add stamp method to SchemaMigrator that calls mark_applied() without running up()
  • Add CLI command with appropriate options
  • Similar to Alembic's stamp command

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions