feat(db): add check for missing migration from 0

This commit is contained in:
psychedelicious 2023-12-11 12:47:52 +11:00
parent c823f5667b
commit 41db92b9e8

View File

@ -91,6 +91,8 @@ class MigrationSet:
if self.latest_version == 0:
return
next_migration = self.get(from_version=0)
if next_migration is None:
raise MigrationError("Migration chain is fragmented")
touched_count = 1
while next_migration is not None:
next_migration = self.get(next_migration.to_version)