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.version_option(__version__, "-V", "--version")
|
||||
@click.option(
|
||||
"-c",
|
||||
"--config",
|
||||
default="aerich.ini",
|
||||
show_default=True,
|
||||
help="Config file.",
|
||||
"-c", "--config", default="aerich.ini", show_default=True, help="Config file.",
|
||||
)
|
||||
@click.option("--app", required=False, help="Tortoise-ORM app name.")
|
||||
@click.option(
|
||||
@ -125,9 +121,7 @@ async def upgrade(ctx: Context):
|
||||
for upgrade_query in upgrade_query_list:
|
||||
await conn.execute_script(upgrade_query)
|
||||
await Aerich.create(
|
||||
version=version_file,
|
||||
app=app,
|
||||
content=get_models_describe(app),
|
||||
version=version_file, app=app, content=get_models_describe(app),
|
||||
)
|
||||
click.secho(f"Success upgrade {version_file}", fg=Color.green)
|
||||
migrated = True
|
||||
@ -221,10 +215,7 @@ async def history(ctx: Context):
|
||||
help="Tortoise-ORM config module dict variable, like settings.TORTOISE_ORM.",
|
||||
)
|
||||
@click.option(
|
||||
"--location",
|
||||
default="./migrations",
|
||||
show_default=True,
|
||||
help="Migrate store location.",
|
||||
"--location", default="./migrations", show_default=True, help="Migrate store location.",
|
||||
)
|
||||
@click.option(
|
||||
"-s",
|
||||
@ -297,9 +288,7 @@ async def init_db(ctx: Context, safe):
|
||||
|
||||
version = await Migrate.generate_version()
|
||||
await Aerich.create(
|
||||
version=version,
|
||||
app=app,
|
||||
content=get_models_describe(app),
|
||||
version=version, app=app, content=get_models_describe(app),
|
||||
)
|
||||
content = {
|
||||
"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.")
|
||||
@click.option(
|
||||
"-t",
|
||||
"--table",
|
||||
help="Which tables to inspect.",
|
||||
multiple=True,
|
||||
required=False,
|
||||
"-t", "--table", help="Which tables to inspect.", multiple=True, required=False,
|
||||
)
|
||||
@click.pass_context
|
||||
@coro
|
||||
|
@ -36,8 +36,7 @@ def get_app_connection_name(config, app_name: str) -> str:
|
||||
if app:
|
||||
return app.get("default_connection", "default")
|
||||
raise BadOptionUsage(
|
||||
option_name="--app",
|
||||
message=f'Can\'t get app named "{app_name}"',
|
||||
option_name="--app", message=f'Can\'t get app named "{app_name}"',
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user