mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
20 lines
556 B
JavaScript
20 lines
556 B
JavaScript
|
exports.up = function (db, cb) {
|
||
|
db.runSql(
|
||
|
`SELECT id
|
||
|
FROM projects`,
|
||
|
(err, results) => {
|
||
|
results.rows.forEach((project) => {
|
||
|
db.runSql(
|
||
|
`INSERT INTO project_environments(project_id, environment_name) VALUES (?, ':global:') ON CONFLICT DO NOTHING;`,
|
||
|
[project.id],
|
||
|
);
|
||
|
});
|
||
|
cb();
|
||
|
},
|
||
|
);
|
||
|
};
|
||
|
|
||
|
exports.down = function (db, cb) {
|
||
|
db.runSql('DELETE FROM project_environments', cb);
|
||
|
};
|