fix version sort

This commit is contained in:
long2ice 2020-07-28 18:31:45 +08:00
parent 18cb75f555
commit e1ffcb609b
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ ChangeLog
0.2.2
-----
- Fix postgres drop fk.
- Fix version sort.
0.2.1
-----

View File

@ -44,7 +44,10 @@ class Migrate:
@classmethod
def get_all_version_files(cls) -> List[str]:
return sorted(filter(lambda x: x.endswith("json"), os.listdir(cls.migrate_location)))
return sorted(
filter(lambda x: x.endswith("json"), os.listdir(cls.migrate_location)),
key=lambda x: x.split("_")[0],
)
@classmethod
async def get_last_version(cls) -> Aerich: