add checkout

This commit is contained in:
Waylon Walker 2023-05-22 08:26:44 -05:00
parent 61fd56bf21
commit ad1b6d19b9
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -1,3 +1,5 @@
import alembic
from alembic.config import Config
import typer
from learn_sql_model.cli.common import verbose_callback
@ -27,9 +29,6 @@ def create_revision(
prompt=True,
),
):
import alembic
# python -m alembic revision --autogenerate -m "New Attribute"
from alembic.config import Config
alembic_cfg = Config("alembic.ini")
alembic.command.revision(
@ -37,6 +36,21 @@ def create_revision(
message=message,
autogenerate=True,
)
alembic.command.upgrade(config=alembic_cfg, revision="head")
@model_app.command()
def checkout(
verbose: bool = typer.Option(
False,
callback=verbose_callback,
help="show the log messages",
),
revision: str = typer.Option("head"),
):
alembic_cfg = Config("alembic.ini")
alembic.command.upgrade(config=alembic_cfg, revision="head")
@model_app.command()