1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/src/migrations/20230306103400-add-project-column-to-segments.js
Gastón Fournier 98d462db27
chore: add a new project column to segments table (#3263)
## About the changes
Adds a migration and persistence layer with a new column
`segment_project_id` to bind a segment to a project.
2023-03-07 14:56:20 +01:00

14 lines
335 B
JavaScript

exports.up = function (db, cb) {
db.runSql(
`ALTER TABLE segments ADD COLUMN segment_project_id varchar(255) REFERENCES projects(id) ON DELETE CASCADE;`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`ALTER TABLE segments DROP COLUMN IF EXISTS segment_project_id;`,
cb,
);
};