fix: migrate
This commit is contained in:
parent
4851ecfe82
commit
15d56121ef
@ -64,9 +64,9 @@ async def cli(ctx: Context, config, app) -> None:
|
|||||||
@click.option("--name", default="update", show_default=True, help="Migrate name.")
|
@click.option("--name", default="update", show_default=True, help="Migrate name.")
|
||||||
@click.option("--empty", default=False, is_flag=True, help="Generate empty migration file.")
|
@click.option("--empty", default=False, is_flag=True, help="Generate empty migration file.")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def migrate(ctx: Context, name) -> None:
|
async def migrate(ctx: Context, name, empty) -> None:
|
||||||
command = ctx.obj["command"]
|
command = ctx.obj["command"]
|
||||||
ret = await command.migrate(name)
|
ret = await command.migrate(name, empty)
|
||||||
if not ret:
|
if not ret:
|
||||||
return click.secho("No changes detected", fg=Color.yellow)
|
return click.secho("No changes detected", fg=Color.yellow)
|
||||||
click.secho(f"Success migrate {ret}", fg=Color.green)
|
click.secho(f"Success migrate {ret}", fg=Color.green)
|
||||||
|
@ -33,8 +33,8 @@ class User(Model):
|
|||||||
|
|
||||||
|
|
||||||
class Email(Model):
|
class Email(Model):
|
||||||
email_id = fields.IntField(pk=True)
|
email_id = fields.IntField(primary_key=True)
|
||||||
email = fields.CharField(max_length=200, index=True)
|
email = fields.CharField(max_length=200, db_index=True)
|
||||||
is_primary = fields.BooleanField(default=False)
|
is_primary = fields.BooleanField(default=False)
|
||||||
address = fields.CharField(max_length=200)
|
address = fields.CharField(max_length=200)
|
||||||
users: fields.ManyToManyRelation[User] = fields.ManyToManyField("models.User")
|
users: fields.ManyToManyRelation[User] = fields.ManyToManyField("models.User")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user