qa iteration 1

This commit is contained in:
master
2026-03-06 00:23:59 +02:00
parent a918d39a61
commit 360485f556
6 changed files with 222 additions and 12 deletions

View File

@@ -0,0 +1,20 @@
-- Platform environment_settings table for setup state and runtime config overrides.
-- Used by SetupStateDetector to determine if setup wizard has been completed.
-- This is idempotent and safe to run on new compose databases.
CREATE SCHEMA IF NOT EXISTS platform;
CREATE TABLE IF NOT EXISTS platform.environment_settings (
key VARCHAR(256) NOT NULL,
value TEXT NOT NULL,
tenant_id VARCHAR(128) NOT NULL DEFAULT '_system',
updated_by VARCHAR(256) NOT NULL DEFAULT 'system',
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
PRIMARY KEY (tenant_id, key)
);
-- Mark setup as complete for fresh installs (docker-compose local dev).
-- The setup wizard can re-run and overwrite this if needed.
INSERT INTO platform.environment_settings (key, value, tenant_id, updated_by)
VALUES ('SetupComplete', 'true', '_system', 'postgres-init')
ON CONFLICT (tenant_id, key) DO NOTHING;