mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-09 23:05:10 +02:00
Update migrations to account for my new ones
This commit is contained in:
+6
-6
@@ -367,11 +367,11 @@ async def run_migrations(conn: aiosqlite.Connection) -> int:
|
||||
await set_version(conn, 47)
|
||||
applied += 1
|
||||
|
||||
# Migration 48: Repeater telemetry history table
|
||||
if version < 48:
|
||||
logger.info("Applying migration 48: repeater telemetry history")
|
||||
await _migrate_048_repeater_telemetry_history(conn)
|
||||
await set_version(conn, 48)
|
||||
# Migration 49: Repeater telemetry history table
|
||||
if version < 49:
|
||||
logger.info("Applying migration 49: repeater telemetry history")
|
||||
await _migrate_049_repeater_telemetry_history(conn)
|
||||
await set_version(conn, 49)
|
||||
applied += 1
|
||||
|
||||
if applied > 0:
|
||||
@@ -2918,7 +2918,7 @@ async def _migrate_047_add_statistics_indexes(conn: aiosqlite.Connection) -> Non
|
||||
await conn.commit()
|
||||
|
||||
|
||||
async def _migrate_048_repeater_telemetry_history(conn: aiosqlite.Connection) -> None:
|
||||
async def _migrate_049_repeater_telemetry_history(conn: aiosqlite.Connection) -> None:
|
||||
"""Create repeater_telemetry_history table for JSON-blob telemetry snapshots."""
|
||||
await conn.execute(
|
||||
"""
|
||||
|
||||
+16
-16
@@ -1247,8 +1247,8 @@ class TestMigration039:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 9
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 10
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
cursor = await conn.execute(
|
||||
"""
|
||||
@@ -1319,8 +1319,8 @@ class TestMigration039:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 9
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 10
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
cursor = await conn.execute(
|
||||
"""
|
||||
@@ -1386,8 +1386,8 @@ class TestMigration039:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 3
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 4
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
cursor = await conn.execute(
|
||||
"""
|
||||
@@ -1439,8 +1439,8 @@ class TestMigration040:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 8
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 9
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
await conn.execute(
|
||||
"""
|
||||
@@ -1501,8 +1501,8 @@ class TestMigration041:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 7
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 8
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
await conn.execute(
|
||||
"""
|
||||
@@ -1554,8 +1554,8 @@ class TestMigration042:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 6
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 7
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
await conn.execute(
|
||||
"""
|
||||
@@ -1694,8 +1694,8 @@ class TestMigration046:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 2
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 3
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
cursor = await conn.execute(
|
||||
"""
|
||||
@@ -1788,8 +1788,8 @@ class TestMigration047:
|
||||
|
||||
applied = await run_migrations(conn)
|
||||
|
||||
assert applied == 1
|
||||
assert await get_version(conn) == 47
|
||||
assert applied == 2
|
||||
assert await get_version(conn) == 49
|
||||
|
||||
cursor = await conn.execute(
|
||||
"""
|
||||
|
||||
@@ -630,6 +630,7 @@ class TestAppSettingsRepository:
|
||||
"flood_scope": "",
|
||||
"blocked_keys": "[]",
|
||||
"blocked_names": "[]",
|
||||
"discovery_blocked_types": "[]",
|
||||
}
|
||||
)
|
||||
mock_conn.execute = AsyncMock(return_value=mock_cursor)
|
||||
|
||||
Reference in New Issue
Block a user