-- users

ALTER TABLE
    "users"
ADD COLUMN
    "dav_token" VARCHAR(255)
;


-- caldav_resources

ALTER TABLE
    "caldav_resources"
RENAME TO
    "ics_feed_resources"
;

ALTER TABLE
    "ics_feed_resources"
DROP COLUMN
    "read_only"
;

ALTER TABLE
    "ics_feed_resources"
ADD COLUMN
    "from_fucked_up_wordpress" BOOLEAN NOT NULL
;

COMMENT ON COLUMN
    "resources"."kind"
IS
    '»local« | »ics_feed«'
;

COMMENT ON COLUMN
    "resources"."sub_id"
IS
    'local_resources.id | ics_feed_resources.id'
;


-- _meta

UPDATE
    "_meta"
SET
    "revision" = 'r4'
;
