1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00

feat: add safeguards migration (#10928)

Safeguards migration
This commit is contained in:
Jaanus Sellin 2025-11-06 11:03:40 +02:00 committed by GitHub
parent 9e7f68abc3
commit fe2d63ad9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,24 @@
'use strict';
exports.up = function (db, cb) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS safeguards (
id TEXT PRIMARY KEY,
impact_metric_id TEXT NOT NULL REFERENCES impact_metrics (id) ON DELETE CASCADE,
action JSONB NOT NULL,
trigger_condition JSONB NOT NULL
);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
DROP TABLE IF EXISTS safeguards;
`,
cb,
);
};