fix(db): persist actual schema version after migrations
This commit is contained in:
@@ -92,8 +92,12 @@ def migrate_database(conn, target_version: int) -> None:
|
|||||||
migrate_fn(conn)
|
migrate_fn(conn)
|
||||||
current_version = version
|
current_version = version
|
||||||
|
|
||||||
|
stored_version = get_current_version(conn)
|
||||||
|
if stored_version != current_version:
|
||||||
|
set_current_version(conn, current_version)
|
||||||
|
|
||||||
if current_version != target_version:
|
if current_version != target_version:
|
||||||
set_current_version(conn, target_version)
|
print(f" [WARN] 目标版本 {target_version} 未完全可达,当前停留在 {current_version}")
|
||||||
|
|
||||||
|
|
||||||
def _migrate_to_v1(conn):
|
def _migrate_to_v1(conn):
|
||||||
|
|||||||
Reference in New Issue
Block a user