Skip to content

Commit

Permalink
fix: migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Aug 6, 2024
1 parent 4851ecf commit 15d5612
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aerich/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("--empty", default=False, is_flag=True, help="Generate empty migration file.")
@click.pass_context
async def migrate(ctx: Context, name) -> None:
async def migrate(ctx: Context, name, empty) -> None:
command = ctx.obj["command"]
ret = await command.migrate(name)
ret = await command.migrate(name, empty)
if not ret:
return click.secho("No changes detected", fg=Color.yellow)
click.secho(f"Success migrate {ret}", fg=Color.green)
Expand Down
4 changes: 2 additions & 2 deletions tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class User(Model):


class Email(Model):
email_id = fields.IntField(pk=True)
email = fields.CharField(max_length=200, index=True)
email_id = fields.IntField(primary_key=True)
email = fields.CharField(max_length=200, db_index=True)
is_primary = fields.BooleanField(default=False)
address = fields.CharField(max_length=200)
users: fields.ManyToManyRelation[User] = fields.ManyToManyField("models.User")
Expand Down

0 comments on commit 15d5612

Please sign in to comment.