Bugfix: Events marked as "removed" And deleteDate is set so the Notification does not get sent

This commit is contained in:
2025-11-06 17:36:54 +00:00
parent 5cdfd0f2e3
commit c703911f85
6 changed files with 23 additions and 12 deletions

View File

@@ -0,0 +1,7 @@
import db from "../src/sql";
db.run(
`UPDATE events
SET notification = 'done'
WHERE deleteDate IS NOT NULL;`
);

View File

@@ -1,7 +1,7 @@
import db from "../src/sql";
const run_migration = db.transaction(() => {
// SQL 1: Insert a new user
// SQL 1: remove duplicates by uid
db.run(`DELETE FROM events
WHERE rowid NOT IN (
SELECT MIN(rowid)
@@ -9,7 +9,7 @@ const run_migration = db.transaction(() => {
GROUP BY uid
);`);
// SQL 2: Update product stock
// SQL 2: create new table with unique key
db.run(`CREATE TABLE events_new (
"event_uid" INTEGER PRIMARY KEY,
"uid" TEXT NOT NULL UNIQUE,