mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-01 19:12:57 +02:00
Migration improvements 2
This commit is contained in:
4
.github/workflows/all-quality.yml
vendored
4
.github/workflows/all-quality.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from hashlib import sha256
|
||||
import logging
|
||||
from hashlib import sha256
|
||||
|
||||
import aiosqlite
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import uuid
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
import aiosqlite
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from hashlib import sha256
|
||||
import logging
|
||||
from hashlib import sha256
|
||||
|
||||
import aiosqlite
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import uuid
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
import aiosqlite
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import uuid
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
import aiosqlite
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import json
|
||||
import logging
|
||||
|
||||
import aiosqlite
|
||||
|
||||
@@ -351,7 +351,9 @@ class TestMigration036:
|
||||
)
|
||||
await conn.commit()
|
||||
|
||||
from app.migrations._036_create_fanout_configs import migrate as _migrate_036_create_fanout_configs
|
||||
from app.migrations._036_create_fanout_configs import (
|
||||
migrate as _migrate_036_create_fanout_configs,
|
||||
)
|
||||
|
||||
await _migrate_036_create_fanout_configs(conn)
|
||||
|
||||
@@ -382,7 +384,9 @@ class TestMigration036:
|
||||
)
|
||||
await conn.commit()
|
||||
|
||||
from app.migrations._036_create_fanout_configs import migrate as _migrate_036_create_fanout_configs
|
||||
from app.migrations._036_create_fanout_configs import (
|
||||
migrate as _migrate_036_create_fanout_configs,
|
||||
)
|
||||
|
||||
await _migrate_036_create_fanout_configs(conn)
|
||||
|
||||
@@ -413,7 +417,9 @@ class TestMigration036:
|
||||
)
|
||||
await conn.commit()
|
||||
|
||||
from app.migrations._036_create_fanout_configs import migrate as _migrate_036_create_fanout_configs
|
||||
from app.migrations._036_create_fanout_configs import (
|
||||
migrate as _migrate_036_create_fanout_configs,
|
||||
)
|
||||
|
||||
await _migrate_036_create_fanout_configs(conn)
|
||||
|
||||
@@ -439,7 +445,9 @@ class TestMigration036:
|
||||
await conn.execute("INSERT INTO app_settings (id) VALUES (1)")
|
||||
await conn.commit()
|
||||
|
||||
from app.migrations._036_create_fanout_configs import migrate as _migrate_036_create_fanout_configs
|
||||
from app.migrations._036_create_fanout_configs import (
|
||||
migrate as _migrate_036_create_fanout_configs,
|
||||
)
|
||||
|
||||
await _migrate_036_create_fanout_configs(conn)
|
||||
|
||||
@@ -536,7 +544,9 @@ class TestMigration038:
|
||||
await conn.execute("INSERT INTO app_settings (id) VALUES (1)")
|
||||
await conn.commit()
|
||||
|
||||
from app.migrations._038_drop_legacy_columns import migrate as _migrate_038_drop_legacy_columns
|
||||
from app.migrations._038_drop_legacy_columns import (
|
||||
migrate as _migrate_038_drop_legacy_columns,
|
||||
)
|
||||
|
||||
await _migrate_038_drop_legacy_columns(conn)
|
||||
|
||||
@@ -561,7 +571,9 @@ class TestMigration038:
|
||||
await conn.execute("CREATE TABLE app_settings (id INTEGER PRIMARY KEY)")
|
||||
await conn.commit()
|
||||
|
||||
from app.migrations._038_drop_legacy_columns import migrate as _migrate_038_drop_legacy_columns
|
||||
from app.migrations._038_drop_legacy_columns import (
|
||||
migrate as _migrate_038_drop_legacy_columns,
|
||||
)
|
||||
|
||||
# Should not raise
|
||||
await _migrate_038_drop_legacy_columns(conn)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations
|
||||
|
||||
|
||||
class TestMigration001:
|
||||
"""Test migration 001: add last_read_at columns."""
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration013:
|
||||
"""Test migration 013: convert bot_enabled/bot_code to multi-bot format."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_migration_converts_existing_bot_to_array(self):
|
||||
"""Migration converts existing bot_enabled/bot_code to bots array."""
|
||||
import json
|
||||
|
||||
conn = await aiosqlite.connect(":memory:")
|
||||
conn.row_factory = aiosqlite.Row
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
from hashlib import sha256
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration018:
|
||||
"""Test migration 018: drop UNIQUE(data) from raw_packets."""
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration019:
|
||||
"""Test migration 019: drop UNIQUE constraint from messages."""
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration020:
|
||||
"""Test migration 020: enable WAL mode and incremental auto-vacuum."""
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration028:
|
||||
"""Test migration 028: convert payload_hash from TEXT to BLOB."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_migration_converts_hex_text_to_blob(self):
|
||||
"""Migration converts 64-char hex TEXT payload_hash values to 32-byte BLOBs."""
|
||||
from hashlib import sha256
|
||||
|
||||
conn = await aiosqlite.connect(":memory:")
|
||||
conn.row_factory = aiosqlite.Row
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration032:
|
||||
"""Test migration 032: add community MQTT columns to app_settings."""
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration033:
|
||||
"""Test migration 033: seed #remoteterm channel."""
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration034:
|
||||
"""Test migration 034: add flood_scope column to app_settings."""
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import get_version, run_migrations, set_version
|
||||
|
||||
from tests.test_migrations.conftest import LATEST_SCHEMA_VERSION
|
||||
|
||||
|
||||
class TestMigration039:
|
||||
"""Test migration 039: persist contacts.out_path_hash_mode."""
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import get_version, run_migrations, set_version
|
||||
|
||||
from tests.test_migrations.conftest import LATEST_SCHEMA_VERSION
|
||||
|
||||
|
||||
class TestMigration040:
|
||||
"""Test migration 040: include path_len in advert-path identity."""
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import get_version, run_migrations, set_version
|
||||
|
||||
from tests.test_migrations.conftest import LATEST_SCHEMA_VERSION
|
||||
|
||||
|
||||
class TestMigration041:
|
||||
"""Test migration 041: add nullable routing override columns."""
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import get_version, run_migrations, set_version
|
||||
|
||||
from tests.test_migrations.conftest import LATEST_SCHEMA_VERSION
|
||||
|
||||
|
||||
class TestMigration042:
|
||||
"""Test migration 042: add channels.flood_scope_override."""
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import pytest
|
||||
|
||||
from app.migrations import run_migrations, set_version
|
||||
|
||||
|
||||
class TestMigration044:
|
||||
"""Test migration 044: dedupe incoming direct messages."""
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import get_version, run_migrations, set_version
|
||||
|
||||
from tests.test_migrations.conftest import LATEST_SCHEMA_VERSION
|
||||
|
||||
|
||||
class TestMigration046:
|
||||
"""Test migration 046: clean orphaned contact child rows."""
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Tests for database migration(s)."""
|
||||
|
||||
|
||||
import aiosqlite
|
||||
import pytest
|
||||
|
||||
from app.migrations import get_version, run_migrations, set_version
|
||||
|
||||
from tests.test_migrations.conftest import LATEST_SCHEMA_VERSION
|
||||
|
||||
|
||||
class TestMigration047:
|
||||
"""Test migration 047: add statistics indexes."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user