diff options
-rw-r--r-- | paste/db.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/paste/db.py b/paste/db.py index c48221f..fc1d98c 100644 --- a/paste/db.py +++ b/paste/db.py @@ -74,7 +74,7 @@ def migrate(connection: sqlite3.Connection, migrations: list[str]) -> None: @contextmanager def connect( - database: str, migrations: list[str] = migrations, **kwargs + database: str, migrations: Optional[list[str]] = migrations, **kwargs ) -> Iterator[sqlite3.Connection]: conn = sqlite3.connect(database, uri=True, **kwargs) conn.execute("PRAGMA foreign_keys = ON") @@ -84,7 +84,8 @@ def connect( conn.create_function( name="DATA_HASH", narg=1, func=_data_hash_udf, deterministic=True ) - migrate(conn, migrations) + if migrations is not None: + migrate(conn, migrations) try: yield conn finally: |