17 lines
688 B
SQL
17 lines
688 B
SQL
-- История desired/actual снапшотов managed-секций (фильтры, рекурсивные маршруты).
|
|
-- Retention — prune в сервисе (последние 50 на пару server+section).
|
|
|
|
CREATE TABLE IF NOT EXISTS config_revisions (
|
|
id TEXT PRIMARY KEY,
|
|
server_id BIGINT NOT NULL REFERENCES servers(id) ON DELETE CASCADE,
|
|
section TEXT NOT NULL,
|
|
source TEXT NOT NULL,
|
|
fingerprint TEXT NOT NULL,
|
|
payload JSONB NOT NULL DEFAULT '[]'::jsonb,
|
|
note TEXT,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_config_revisions_server_section_created
|
|
ON config_revisions (server_id, section, created_at DESC);
|