Skip to content

Commit

Permalink
Fix migrations revision store checks (close #487)
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Feb 27, 2024
1 parent 8f3771f commit 89abfa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions emmett/orm/migrations/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ def _store_current_revision_(self, ctx, source, dest):
}
source = to_tuple(source)
dest = to_tuple(dest)
if source is None:
if not source and dest:
_store_logs['new'](dest[0])
ctx.db.Schema.insert(version=dest[0])
ctx.db.commit()
ctx._current_revision_ = [dest[0]]
return
if dest is None:
if not dest and source:
_store_logs['del'](source[0])
ctx.db(ctx.db.Schema.version == source[0]).delete()
ctx.db.commit()
Expand Down

0 comments on commit 89abfa9

Please sign in to comment.