You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
431 B
Python

import click
from redis_developer.om.migrations.migrator import Migrator
@click.command()
@click.option("--module", default="redis_developer")
def migrate(module):
migrator = Migrator(module)
if migrator.migrations:
print("Pending migrations:")
for migration in migrator.migrations:
print(migration)
if input(f"Run migrations? (y/n) ") == "y":
migrator.run()