oficina / calendar Public

Clone
git clone https://amadan.net/oficina/calendar

Plain git — no account needed to clone.

Download

Download this file

1ALTER TABLE `people` ADD `name_sealed` blob;
2
3ALTER TABLE `people` ADD `week_start` integer NOT NULL;
4
5ALTER TABLE `people` ADD `default_reminder_min` integer NOT NULL;
6
7ALTER TABLE `people` ADD `default_all_day_min` integer NOT NULL;
8
9CREATE TABLE `calendars` (`id` integer PRIMARY KEY AUTOINCREMENT,`name_sealed` blob,`kind` text NOT NULL,`owner_id` integer NOT NULL,`hue` integer NOT NULL,`created_at` datetime NOT NULL,`archived_at` datetime);
10
11CREATE INDEX `idx_calendars_archived_at` ON `calendars`(`archived_at`);
12
13CREATE INDEX `idx_calendars_owner_id` ON `calendars`(`owner_id`);
14
15CREATE TABLE `grants` (`id` integer PRIMARY KEY AUTOINCREMENT,`calendar_id` integer NOT NULL,`person_id` integer NOT NULL,`role` text NOT NULL,`granted_by` integer NOT NULL,`created_at` datetime NOT NULL);
16
17CREATE UNIQUE INDEX `idx_grant_cal_person` ON `grants`(`calendar_id`,`person_id`);
18
19CREATE TABLE `events` (`id` integer PRIMARY KEY AUTOINCREMENT,`calendar_id` integer NOT NULL,`uid_hash` text NOT NULL,`uid_sealed` blob,`series_id` integer,`recurrence_id_local` text NOT NULL,`title_sealed` blob,`location_sealed` blob,`notes_sealed` blob,`all_day` numeric NOT NULL,`start_local` text NOT NULL,`end_local` text NOT NULL,`tz` text NOT NULL,`start_utc` integer NOT NULL,`end_utc` integer NOT NULL,`rrule` text NOT NULL,`rrule_foreign` numeric NOT NULL,`until_utc` integer,`exdates` text NOT NULL,`kind` text NOT NULL,`status` text NOT NULL,`sequence` integer NOT NULL,`created_by` integer NOT NULL,`created_at` datetime NOT NULL,`updated_at` datetime NOT NULL,`deleted_at` datetime);
20
21CREATE INDEX `idx_events_deleted_at` ON `events`(`deleted_at`);
22
23CREATE INDEX `idx_events_until_utc` ON `events`(`until_utc`);
24
25CREATE INDEX `idx_events_end_utc` ON `events`(`end_utc`);
26
27CREATE INDEX `idx_events_start_utc` ON `events`(`start_utc`);
28
29CREATE INDEX `idx_events_series_id` ON `events`(`series_id`);
30
31CREATE INDEX `idx_events_uid_hash` ON `events`(`uid_hash`);
32
33CREATE INDEX `idx_events_calendar_id` ON `events`(`calendar_id`);
34
35CREATE TABLE `reminders` (`id` integer PRIMARY KEY AUTOINCREMENT,`event_id` integer NOT NULL,`person_id` integer NOT NULL,`offset_min` integer NOT NULL,`channel` text NOT NULL,`created_at` datetime NOT NULL);
36
37CREATE INDEX `idx_reminders_person_id` ON `reminders`(`person_id`);
38
39CREATE INDEX `idx_reminders_event_id` ON `reminders`(`event_id`);
40
41CREATE TABLE `reminder_queues` (`id` integer PRIMARY KEY AUTOINCREMENT,`reminder_id` integer NOT NULL,`occurrence_key` text NOT NULL,`due_at` integer NOT NULL,`claimed_at` integer,`fired_at` integer,`attempts` integer NOT NULL,`late_by_sec` integer NOT NULL);
42
43CREATE INDEX `idx_reminder_queues_due_at` ON `reminder_queues`(`due_at`);
44
45CREATE INDEX `idx_reminder_queues_occurrence_key` ON `reminder_queues`(`occurrence_key`);
46
47CREATE UNIQUE INDEX `idx_reminder_queues_reminder_id` ON `reminder_queues`(`reminder_id`);
48
49CREATE TABLE `feeds` (`id` integer PRIMARY KEY AUTOINCREMENT,`person_id` integer NOT NULL,`calendar_id` integer NOT NULL,`token_hash` text NOT NULL,`created_at` datetime NOT NULL,`revoked_at` datetime,`last_polled_at` datetime,`poll_count` integer NOT NULL);
50
51CREATE UNIQUE INDEX `idx_feeds_token_hash` ON `feeds`(`token_hash`);
52
53CREATE INDEX `idx_feeds_calendar_id` ON `feeds`(`calendar_id`);
54
55CREATE INDEX `idx_feeds_person_id` ON `feeds`(`person_id`);
56
57CREATE TABLE `meta` (`key` text,`value` text NOT NULL,PRIMARY KEY (`key`));
58
59