mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-11-29 08:56:03 +00:00
Add a primary key to calendar_alarm table.
Also fixed a bug in scripts/refresh-alarms.php if there was an alarm with a duplicate trigger. This is part of the fix for #276.
This commit is contained in:
1 parent
6819d6d7d1
commit
e3b5c331be
5 files changed
+25
-9
No files matched your search
+3
-1
@@ -403,13 +403,15 @@ CREATE TABLE addressbook_address_email (
|
||||
|
||||
CREATE TABLE calendar_alarm (
|
||||
dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
count INT,
|
||||
action TEXT,
|
||||
trigger TEXT,
|
||||
summary TEXT,
|
||||
description TEXT,
|
||||
next_trigger TIMESTAMP WITH TIME ZONE,
|
||||
component TEXT, -- The full text of the component
|
||||
trigger_state CHAR DEFAULT 'N' -- 'N' => 'New/Needs setting', 'A' = 'Active', 'O' = 'Old'
|
||||
trigger_state CHAR DEFAULT 'N', -- 'N' => 'New/Needs setting', 'A' = 'Active', 'O' = 'Old'
|
||||
UNIQUE (dav_id, count)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -41,6 +41,16 @@ UPDATE addressbook_address_tel
|
||||
CREATE UNIQUE INDEX addressbook_address_tel_pk
|
||||
ON addressbook_address_tel(dav_id, count);
|
||||
|
||||
-- calendar_alarm
|
||||
ALTER TABLE calendar_alarm
|
||||
ADD COLUMN count INT;
|
||||
|
||||
UPDATE calendar_alarm
|
||||
SET count = nextval('temporary_seq');
|
||||
|
||||
CREATE UNIQUE INDEX calendar_alarms_pk
|
||||
ON calendar_alarm(dav_id, count);
|
||||
|
||||
-- Tidy up after ourselves.
|
||||
DROP SEQUENCE temporary_seq;
|
||||
|
||||
|
||||
Reference in new issue
Block a user