feat: add is_flag to init-db

This commit is contained in:
long2ice
2022-05-24 11:20:12 +08:00
parent 0b01fa38d8
commit 4abc464ce0
4 changed files with 137 additions and 132 deletions

View File

@@ -215,15 +215,17 @@ async def init(ctx: Context, tortoise_orm, location, src_folder):
@cli.command(help="Generate schema and generate app migrate location.")
@click.option(
"-s",
"--safe",
type=bool,
is_flag=True,
default=True,
help="When set to true, creates the table only when it does not already exist.",
show_default=True,
)
@click.pass_context
@coro
async def init_db(ctx: Context, safe):
async def init_db(ctx: Context, safe: bool):
command = ctx.obj["command"]
app = command.app
dirname = Path(command.location, app)

View File

@@ -1 +1 @@
__version__ = "0.6.3"
__version__ = "0.6.4"