| 1 | ALTER TABLE `people` ADD `name_sealed` blob; |
| 2 | |
| 3 | ALTER TABLE `people` ADD `week_start` integer NOT NULL; |
| 4 | |
| 5 | ALTER TABLE `people` ADD `default_reminder_min` integer NOT NULL; |
| 6 | |
| 7 | ALTER TABLE `people` ADD `default_all_day_min` integer NOT NULL; |
| 8 | |
| 9 | CREATE 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 | |
| 11 | CREATE INDEX `idx_calendars_archived_at` ON `calendars`(`archived_at`); |
| 12 | |
| 13 | CREATE INDEX `idx_calendars_owner_id` ON `calendars`(`owner_id`); |
| 14 | |
| 15 | CREATE 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 | |
| 17 | CREATE UNIQUE INDEX `idx_grant_cal_person` ON `grants`(`calendar_id`,`person_id`); |
| 18 | |
| 19 | CREATE 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 | |
| 21 | CREATE INDEX `idx_events_deleted_at` ON `events`(`deleted_at`); |
| 22 | |
| 23 | CREATE INDEX `idx_events_until_utc` ON `events`(`until_utc`); |
| 24 | |
| 25 | CREATE INDEX `idx_events_end_utc` ON `events`(`end_utc`); |
| 26 | |
| 27 | CREATE INDEX `idx_events_start_utc` ON `events`(`start_utc`); |
| 28 | |
| 29 | CREATE INDEX `idx_events_series_id` ON `events`(`series_id`); |
| 30 | |
| 31 | CREATE INDEX `idx_events_uid_hash` ON `events`(`uid_hash`); |
| 32 | |
| 33 | CREATE INDEX `idx_events_calendar_id` ON `events`(`calendar_id`); |
| 34 | |
| 35 | CREATE 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 | |
| 37 | CREATE INDEX `idx_reminders_person_id` ON `reminders`(`person_id`); |
| 38 | |
| 39 | CREATE INDEX `idx_reminders_event_id` ON `reminders`(`event_id`); |
| 40 | |
| 41 | CREATE 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 | |
| 43 | CREATE INDEX `idx_reminder_queues_due_at` ON `reminder_queues`(`due_at`); |
| 44 | |
| 45 | CREATE INDEX `idx_reminder_queues_occurrence_key` ON `reminder_queues`(`occurrence_key`); |
| 46 | |
| 47 | CREATE UNIQUE INDEX `idx_reminder_queues_reminder_id` ON `reminder_queues`(`reminder_id`); |
| 48 | |
| 49 | CREATE 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 | |
| 51 | CREATE UNIQUE INDEX `idx_feeds_token_hash` ON `feeds`(`token_hash`); |
| 52 | |
| 53 | CREATE INDEX `idx_feeds_calendar_id` ON `feeds`(`calendar_id`); |
| 54 | |
| 55 | CREATE INDEX `idx_feeds_person_id` ON `feeds`(`person_id`); |
| 56 | |
| 57 | CREATE TABLE `meta` (`key` text,`value` text NOT NULL,PRIMARY KEY (`key`)); |
| 58 | |
| 59 | |