-- SQLite is used for schema parity and local fixtures; the production render -- admission barrier is implemented by the PostgreSQL repository. CREATE TABLE tenant_render_generation ( tenant_id TEXT PRIMARY KEY REFERENCES tenant(id) ON DELETE CASCADE, generation INTEGER NOT NULL DEFAULT 1 ); INSERT INTO tenant_render_generation(tenant_id, generation) SELECT id, 1 FROM tenant; ALTER TABLE module_prefix_snapshot ADD COLUMN snapshot_version INTEGER NOT NULL DEFAULT 0; CREATE TABLE render_revision_manifest ( revision_id TEXT PRIMARY KEY REFERENCES config_revision(id) ON DELETE CASCADE, tenant_id TEXT NOT NULL REFERENCES tenant(id) ON DELETE CASCADE, config_generation INTEGER NOT NULL, manifest_json TEXT NOT NULL );