redis / redis/redis-om-python

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

Open
#774 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.3k
Forks
128
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating SchemaMigrator and the existing migration CLI commands. Trace how migrations are marked applied and how CLI options are defined. Done means supporting stamp for all pending migrations, a specific migration, and a target without running up().

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
cli, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.