used old black version
This commit is contained in:
parent
185514f711
commit
62840136be
@ -48,11 +48,7 @@ def coro(f):
|
|||||||
@click.group(context_settings={"help_option_names": ["-h", "--help"]})
|
@click.group(context_settings={"help_option_names": ["-h", "--help"]})
|
||||||
@click.version_option(__version__, "-V", "--version")
|
@click.version_option(__version__, "-V", "--version")
|
||||||
@click.option(
|
@click.option(
|
||||||
"-c",
|
"-c", "--config", default="aerich.ini", show_default=True, help="Config file.",
|
||||||
"--config",
|
|
||||||
default="aerich.ini",
|
|
||||||
show_default=True,
|
|
||||||
help="Config file.",
|
|
||||||
)
|
)
|
||||||
@click.option("--app", required=False, help="Tortoise-ORM app name.")
|
@click.option("--app", required=False, help="Tortoise-ORM app name.")
|
||||||
@click.option(
|
@click.option(
|
||||||
@ -125,9 +121,7 @@ async def upgrade(ctx: Context):
|
|||||||
for upgrade_query in upgrade_query_list:
|
for upgrade_query in upgrade_query_list:
|
||||||
await conn.execute_script(upgrade_query)
|
await conn.execute_script(upgrade_query)
|
||||||
await Aerich.create(
|
await Aerich.create(
|
||||||
version=version_file,
|
version=version_file, app=app, content=get_models_describe(app),
|
||||||
app=app,
|
|
||||||
content=get_models_describe(app),
|
|
||||||
)
|
)
|
||||||
click.secho(f"Success upgrade {version_file}", fg=Color.green)
|
click.secho(f"Success upgrade {version_file}", fg=Color.green)
|
||||||
migrated = True
|
migrated = True
|
||||||
@ -221,10 +215,7 @@ async def history(ctx: Context):
|
|||||||
help="Tortoise-ORM config module dict variable, like settings.TORTOISE_ORM.",
|
help="Tortoise-ORM config module dict variable, like settings.TORTOISE_ORM.",
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--location",
|
"--location", default="./migrations", show_default=True, help="Migrate store location.",
|
||||||
default="./migrations",
|
|
||||||
show_default=True,
|
|
||||||
help="Migrate store location.",
|
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"-s",
|
"-s",
|
||||||
@ -297,9 +288,7 @@ async def init_db(ctx: Context, safe):
|
|||||||
|
|
||||||
version = await Migrate.generate_version()
|
version = await Migrate.generate_version()
|
||||||
await Aerich.create(
|
await Aerich.create(
|
||||||
version=version,
|
version=version, app=app, content=get_models_describe(app),
|
||||||
app=app,
|
|
||||||
content=get_models_describe(app),
|
|
||||||
)
|
)
|
||||||
content = {
|
content = {
|
||||||
"upgrade": [schema],
|
"upgrade": [schema],
|
||||||
@ -310,11 +299,7 @@ async def init_db(ctx: Context, safe):
|
|||||||
|
|
||||||
@cli.command(help="Introspects the database tables to standard output as TortoiseORM model.")
|
@cli.command(help="Introspects the database tables to standard output as TortoiseORM model.")
|
||||||
@click.option(
|
@click.option(
|
||||||
"-t",
|
"-t", "--table", help="Which tables to inspect.", multiple=True, required=False,
|
||||||
"--table",
|
|
||||||
help="Which tables to inspect.",
|
|
||||||
multiple=True,
|
|
||||||
required=False,
|
|
||||||
)
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@coro
|
@coro
|
||||||
|
@ -36,8 +36,7 @@ def get_app_connection_name(config, app_name: str) -> str:
|
|||||||
if app:
|
if app:
|
||||||
return app.get("default_connection", "default")
|
return app.get("default_connection", "default")
|
||||||
raise BadOptionUsage(
|
raise BadOptionUsage(
|
||||||
option_name="--app",
|
option_name="--app", message=f'Can\'t get app named "{app_name}"',
|
||||||
message=f'Can\'t get app named "{app_name}"',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user