oficina / calendar Public

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

Plain git — no account needed to clone.

Download

Download this file

1-- Generated by rastrillo migration generate; DO NOT EDIT.
2-- The schema every migration in this directory adds up to.
3
4CREATE TABLE `attendees` (`id` integer PRIMARY KEY AUTOINCREMENT,`event_id` integer NOT NULL,`address_sealed` blob,`address_fp` text NOT NULL,`created_at` datetime NOT NULL);
5
6CREATE TABLE `booking_mails` (`id` integer PRIMARY KEY AUTOINCREMENT,`booking_id` integer NOT NULL,`kind` text NOT NULL,`recipient` text NOT NULL,`revision` integer NOT NULL,`due_at` integer NOT NULL,`attempts` integer NOT NULL,`claimed_at` integer,`claim_id` text NOT NULL,`sent_at` integer,`created_at` datetime NOT NULL);
7
8CREATE TABLE `booking_pages` (`id` integer PRIMARY KEY AUTOINCREMENT,`person_id` integer NOT NULL,`code` text NOT NULL,`title_sealed` blob,`description_sealed` blob,`duration_min` integer NOT NULL,`buffer_min` integer NOT NULL,`notice_min` integer NOT NULL,`horizon_days` integer NOT NULL,`availability_text_sealed` blob,`published_at` integer,`created_at` datetime NOT NULL,`updated_at` datetime NOT NULL);
9
10CREATE TABLE `booking_windows` (`id` integer PRIMARY KEY AUTOINCREMENT,`page_id` integer NOT NULL,`weekday` integer NOT NULL,`start_min` integer NOT NULL,`end_min` integer NOT NULL);
11
12CREATE TABLE `bookings` (`id` integer PRIMARY KEY AUTOINCREMENT,`page_id` integer NOT NULL,`event_id` integer NOT NULL,`token_hash` text NOT NULL,`token_sealed` blob,`state` text NOT NULL,`title_sealed` blob,`description_sealed` blob,`booker_name_sealed` blob,`booker_address_sealed` blob,`booker_address_fp` text NOT NULL,`note_sealed` blob,`booker_zone` text NOT NULL,`hold_expires_at` integer NOT NULL,`confirmed_at` integer,`cancelled_at` integer,`cancelled_by` text NOT NULL,`ip_fp` text,`ip_forget_at` integer NOT NULL,`reschedules` integer NOT NULL,`created_at` datetime NOT NULL,`updated_at` datetime NOT NULL);
13
14CREATE 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);
15
16CREATE 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);
17
18CREATE 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);
19
20CREATE 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);
21
22CREATE TABLE `meta` (`key` text,`value` text NOT NULL,PRIMARY KEY (`key`));
23
24CREATE TABLE `people` (`id` integer PRIMARY KEY AUTOINCREMENT,`address` text NOT NULL,`zone` text NOT NULL,`created_at` datetime NOT NULL,`updated_at` datetime NOT NULL, `name_sealed` blob, `week_start` integer NOT NULL, `default_reminder_min` integer NOT NULL, `default_all_day_min` integer NOT NULL, `handle` text);
25
26CREATE 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, `claim_id` text, `retry_at` integer);
27
28CREATE 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, `undeliverable_at` integer);
29
30CREATE INDEX `idx_attendees_address_fp` ON `attendees`(`address_fp`);
31
32CREATE INDEX `idx_attendees_event_id` ON `attendees`(`event_id`);
33
34CREATE UNIQUE INDEX `idx_booking_mail_once` ON `booking_mails`(`booking_id`,`kind`,`recipient`,`revision`);
35
36CREATE INDEX `idx_booking_mails_due_at` ON `booking_mails`(`due_at`);
37
38CREATE UNIQUE INDEX `idx_booking_page_code` ON `booking_pages`(`person_id`,`code`);
39
40CREATE INDEX `idx_booking_windows_page_id` ON `booking_windows`(`page_id`);
41
42CREATE INDEX `idx_bookings_booker_address_fp` ON `bookings`(`booker_address_fp`);
43
44CREATE INDEX `idx_bookings_event_id` ON `bookings`(`event_id`);
45
46CREATE INDEX `idx_bookings_hold_expires_at` ON `bookings`(`hold_expires_at`);
47
48CREATE INDEX `idx_bookings_ip_forget_at` ON `bookings`(`ip_forget_at`);
49
50CREATE INDEX `idx_bookings_ip_fp` ON `bookings`(`ip_fp`);
51
52CREATE INDEX `idx_bookings_page_id` ON `bookings`(`page_id`);
53
54CREATE INDEX `idx_bookings_state` ON `bookings`(`state`);
55
56CREATE UNIQUE INDEX `idx_bookings_token_hash` ON `bookings`(`token_hash`);
57
58CREATE INDEX `idx_calendars_archived_at` ON `calendars`(`archived_at`);
59
60CREATE INDEX `idx_calendars_owner_id` ON `calendars`(`owner_id`);
61
62CREATE INDEX `idx_events_calendar_id` ON `events`(`calendar_id`);
63
64CREATE INDEX `idx_events_deleted_at` ON `events`(`deleted_at`);
65
66CREATE INDEX `idx_events_end_utc` ON `events`(`end_utc`);
67
68CREATE INDEX `idx_events_series_id` ON `events`(`series_id`);
69
70CREATE INDEX `idx_events_start_utc` ON `events`(`start_utc`);
71
72CREATE INDEX `idx_events_uid_hash` ON `events`(`uid_hash`);
73
74CREATE INDEX `idx_events_until_utc` ON `events`(`until_utc`);
75
76CREATE INDEX `idx_feeds_calendar_id` ON `feeds`(`calendar_id`);
77
78CREATE INDEX `idx_feeds_person_id` ON `feeds`(`person_id`);
79
80CREATE UNIQUE INDEX `idx_feeds_token_hash` ON `feeds`(`token_hash`);
81
82CREATE UNIQUE INDEX `idx_grant_cal_person` ON `grants`(`calendar_id`,`person_id`);
83
84CREATE UNIQUE INDEX `idx_people_address` ON `people`(`address`);
85
86CREATE UNIQUE INDEX `idx_people_handle` ON `people`(`handle`);
87
88CREATE INDEX `idx_reminder_queues_due_at` ON `reminder_queues`(`due_at`);
89
90CREATE INDEX `idx_reminder_queues_occurrence_key` ON `reminder_queues`(`occurrence_key`);
91
92CREATE UNIQUE INDEX `idx_reminder_queues_reminder_id` ON `reminder_queues`(`reminder_id`);
93
94CREATE INDEX `idx_reminders_event_id` ON `reminders`(`event_id`);
95
96CREATE INDEX `idx_reminders_person_id` ON `reminders`(`person_id`);
97
98