1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/migrations/20210323073508-reset-application-announcements.js
Christopher Kolstad 2e13bb9368
Make sure we keep the announced status of each app (#770)
* Make sure we keep the announced status of each app

- Since we were running onConflict().merge() we were keeping our entire
  new object from our remapRow method, and that was overwriting the
  current announcement status of the row back to false, unless we'd by
  random chance actually set the announced property on our row to be
  inserted.
* Add migration for cleaning up application-created events
-
fixes: #769
2021-03-23 12:43:33 +01:00

12 lines
212 B
JavaScript

'use strict';
exports.up = function(db, cb) {
db.runSql(
`
DELETE FROM events WHERE type = 'application-created';
UPDATE client_applications SET announced = false;
`,
cb,
);
};