fix version sort and add test

This commit is contained in:
long2ice
2020-07-29 10:21:43 +08:00
parent e1ffcb609b
commit 17ab0a1421
4 changed files with 125 additions and 83 deletions

View File

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