Fixing the uid Column isn't unique.
uid is required to be unique for the the Changed Events (with the new Data) to be inserted without creating new Rows.
This commit is contained in:
@@ -42,9 +42,9 @@ export class Event implements TEventEntity {
|
||||
deleteDate: TEventEntity["deleteDate"];
|
||||
|
||||
static createTable (db: Database): void {
|
||||
const query = db.query(`CREATE TABLE IF NOT EXISTS "events" (
|
||||
"event_uid" INTEGER NOT NULL,
|
||||
"uid" TEXT NOT NULL,
|
||||
const query = db.query(`CREATE TABLE IF NOT EXISTS "events"
|
||||
"event_uid" INTEGER PRIMARY KEY,
|
||||
"uid" TEXT NOT NULL UNIQUE,
|
||||
"title" TEXT NOT NULL,
|
||||
"date_at" DATETIME NOT NULL,
|
||||
"time_start" TEXT NOT NULL,
|
||||
@@ -56,10 +56,8 @@ export class Event implements TEventEntity {
|
||||
"description" TEXT NOT NULL,
|
||||
"timezone" TEXT NOT NULL,
|
||||
"notification" TEXT NOT NULL,
|
||||
"deleteDate" INTEGER NULL,
|
||||
PRIMARY KEY ("event_uid")
|
||||
);
|
||||
CREATE UNIQUE INDEX "sqlite_autoindex_events_1" ON "events" ("uid");`);
|
||||
"deleteDate" INTEGER NULL
|
||||
);`);
|
||||
query.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user