chore: make style, upgrade deps, fix ci error and update changelog
This commit is contained in:
@@ -37,7 +37,9 @@ async def cli(ctx: Context, config, app) -> None:
|
||||
if invoked_subcommand != "init":
|
||||
config_path = Path(config)
|
||||
if not config_path.exists():
|
||||
raise UsageError("You need to run `aerich init` first to create the config file.", ctx=ctx)
|
||||
raise UsageError(
|
||||
"You need to run `aerich init` first to create the config file.", ctx=ctx
|
||||
)
|
||||
content = config_path.read_text()
|
||||
doc: dict = tomlkit.parse(content)
|
||||
try:
|
||||
@@ -56,7 +58,9 @@ async def cli(ctx: Context, config, app) -> None:
|
||||
ctx.obj["command"] = command
|
||||
if invoked_subcommand != "init-db":
|
||||
if not Path(location, app).exists():
|
||||
raise UsageError("You need to run `aerich init-db` first to initialize the database.", ctx=ctx)
|
||||
raise UsageError(
|
||||
"You need to run `aerich init-db` first to initialize the database.", ctx=ctx
|
||||
)
|
||||
await command.init()
|
||||
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ class Migrate:
|
||||
ret: list = []
|
||||
|
||||
def index_hash(self) -> str:
|
||||
h = hashlib.new("MD5", usedforsecurity=False)
|
||||
h = hashlib.new("MD5", usedforsecurity=False) # type:ignore[call-arg]
|
||||
h.update(
|
||||
self.index_name(cls.ddl.schema_generator, model).encode()
|
||||
+ self.__class__.__name__.encode()
|
||||
|
||||
@@ -9,7 +9,7 @@ MAX_APP_LENGTH = 100
|
||||
class Aerich(Model):
|
||||
version = fields.CharField(max_length=MAX_VERSION_LENGTH)
|
||||
app = fields.CharField(max_length=MAX_APP_LENGTH)
|
||||
content = fields.JSONField(encoder=encoder, decoder=decoder)
|
||||
content: dict = fields.JSONField(encoder=encoder, decoder=decoder)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-id"]
|
||||
|
||||
Reference in New Issue
Block a user