mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-06 08:52:50 +02:00
f342f5bc70
- config: add DatabaseBackend enum + DATABASE_* component vars on CommonSettings (host/port/name/schema/user/password, defaults 'meshcorehub'); single effective_database_url resolver with precedence DATABASE_URL > postgres (assembled, fail-fast on missing vars) > SQLite default. effective_database_schema returns the schema only for Postgres. Collapses the duplicated resolver/field out of Collector/API settings. - database: create_database_engine/DatabaseManager accept a schema arg and scope Postgres connections via search_path (psycopg2 -c options; asyncpg server_settings). No-op for SQLite. - alembic/env: migrate into the instance schema (version_table_schema + CREATE SCHEMA + search_path) for Postgres; fix online render_as_batch to be SQLite-only (matching the offline path). - .env.example: document the DATABASE_* block. SQLite behaviour unchanged: default no-env path resolves to the same URL (new regression tests), full suite green (1051 passed), fresh db upgrade OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>