feat(db): tweak docstring

This commit is contained in:
psychedelicious 2023-12-12 11:13:40 +11:00
parent c5ba4f2ea5
commit 6063760ce2

View File

@ -55,10 +55,9 @@ class SQLiteMigrator:
def _run_migration(self, migration: Migration) -> None:
"""Runs a single migration."""
# Using sqlite3.Connection as a context manager commits a the transaction on exit, or rolls it back if an
# exception is raised. We want to commit the transaction if the migration is successful, or roll it back if
# there is an error.
try:
# Using sqlite3.Connection as a context manager commits a the transaction on exit, or rolls it back if an
# exception is raised.
with self._db.lock, self._db.conn as conn:
cursor = conn.cursor()
if self._get_current_version(cursor) != migration.from_version: