Add channel material and downtime analytics

This commit is contained in:
2026-10-01 12:27:47 +02:00
parent 5452dc035b
commit 640ec53330
24 changed files with 2362 additions and 76 deletions
+21
View File
@@ -0,0 +1,21 @@
"""Shared test adaptations for the production PostgreSQL schema."""
import re
from pathlib import Path
import pytest
@pytest.fixture(scope="session")
def sqlite_schema() -> str:
"""Keep PostgreSQL DDL authoritative; adapt JSON storage and clock for SQLite.
SQLite stores serialized JSON as text. These tests exercise schema and INSERT
semantics, not PostgreSQL JSONB operators or TimescaleDB behavior.
"""
schema = (Path(__file__).resolve().parents[1] / "db" / "schema.sql").read_text(
encoding="utf-8"
)
schema = re.sub(r"::jsonb\b", "", schema)
schema = re.sub(r"\bjsonb\b", "text", schema)
return schema.replace("DEFAULT now()", "DEFAULT CURRENT_TIMESTAMP")