mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
29 lines
755 B
JavaScript
29 lines
755 B
JavaScript
'use strict';
|
|
|
|
exports.up = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
CREATE TABLE IF NOT EXISTS dependent_features
|
|
(
|
|
parent varchar(255) NOT NULL,
|
|
child varchar(255) NOT NULL,
|
|
enabled boolean DEFAULT true NOT NULL,
|
|
variants JSONB DEFAULT '[]'::jsonb NOT NULL,
|
|
PRIMARY KEY (parent, child),
|
|
FOREIGN KEY (parent) REFERENCES features (name) ON DELETE RESTRICT,
|
|
FOREIGN KEY (child) REFERENCES features (name) ON DELETE CASCADE
|
|
);
|
|
`,
|
|
cb(),
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
DROP TABLE dependent_features;
|
|
`,
|
|
cb,
|
|
);
|
|
};
|