| 1 | -- Generated by rastrillo migration generate; DO NOT EDIT. |
| 2 | -- The schema every migration in this directory adds up to. |
| 3 | |
| 4 | CREATE TABLE `agents` (`id` integer PRIMARY KEY AUTOINCREMENT,`name` text NOT NULL,`operator_person_id` integer NOT NULL,`token_hash` text NOT NULL,`created_at` datetime,`revoked_at` datetime); |
| 5 | |
| 6 | CREATE TABLE `device_tokens` (`id` integer PRIMARY KEY AUTOINCREMENT,`person_id` integer NOT NULL,`token` text NOT NULL,`platform` text NOT NULL,`created_at` datetime,`last_seen` datetime); |
| 7 | |
| 8 | CREATE TABLE `guest_grants` (`id` integer PRIMARY KEY AUTOINCREMENT,`meeting_id` integer NOT NULL,`person_id` integer NOT NULL,`granted_at` datetime,`expires_at` datetime,`admitted_at` datetime,`admitted_by` text); |
| 9 | |
| 10 | CREATE TABLE `meeting_defaults` (`id` integer PRIMARY KEY AUTOINCREMENT,`require_signin` numeric NOT NULL DEFAULT false,`waiting_room` numeric NOT NULL DEFAULT false); |
| 11 | |
| 12 | CREATE TABLE `meeting_links` (`id` integer PRIMARY KEY AUTOINCREMENT,`meeting_id` integer NOT NULL,`token_hash` text NOT NULL,`created_by` text NOT NULL,`created_at` datetime,`revoked_at` datetime, `token_sealed` blob); |
| 13 | |
| 14 | CREATE TABLE `meetings` (`id` integer PRIMARY KEY AUTOINCREMENT,`sqid` text NOT NULL,`title_sealed` blob,`starts_at` datetime,`created_by` text NOT NULL,`created_at` datetime,`ended_at` datetime,`ended_by` text, `require_signin` numeric NOT NULL DEFAULT false, `waiting_room` numeric NOT NULL DEFAULT false, `auto_title` numeric NOT NULL DEFAULT false, `title_zone` text NOT NULL DEFAULT ""); |
| 15 | |
| 16 | CREATE TABLE `pending_joins` (`id` integer PRIMARY KEY AUTOINCREMENT,`meeting_id` integer NOT NULL,`link_id` integer NOT NULL,`address_fingerprint` text NOT NULL,`created_at` datetime,`expires_at` datetime); |
| 17 | |
| 18 | CREATE TABLE `persons` (`id` integer PRIMARY KEY AUTOINCREMENT,`email` text NOT NULL,`name` text NOT NULL,`created_at` datetime, `anonymous` numeric NOT NULL DEFAULT false); |
| 19 | |
| 20 | CREATE INDEX `idx_agents_operator_person_id` ON `agents`(`operator_person_id`); |
| 21 | |
| 22 | CREATE UNIQUE INDEX `idx_agents_token_hash` ON `agents`(`token_hash`); |
| 23 | |
| 24 | CREATE INDEX `idx_device_tokens_person_id` ON `device_tokens`(`person_id`); |
| 25 | |
| 26 | CREATE UNIQUE INDEX `idx_device_tokens_token` ON `device_tokens`(`token`); |
| 27 | |
| 28 | CREATE UNIQUE INDEX `idx_grant_meeting_person` ON `guest_grants`(`meeting_id`,`person_id`); |
| 29 | |
| 30 | CREATE INDEX `idx_guest_grants_expires_at` ON `guest_grants`(`expires_at`); |
| 31 | |
| 32 | CREATE INDEX `idx_meeting_links_meeting_id` ON `meeting_links`(`meeting_id`); |
| 33 | |
| 34 | CREATE UNIQUE INDEX `idx_meeting_links_token_hash` ON `meeting_links`(`token_hash`); |
| 35 | |
| 36 | CREATE UNIQUE INDEX `idx_meetings_sqid` ON `meetings`(`sqid`); |
| 37 | |
| 38 | CREATE INDEX `idx_pending_joins_address_fingerprint` ON `pending_joins`(`address_fingerprint`); |
| 39 | |
| 40 | CREATE UNIQUE INDEX `idx_persons_email` ON `persons`(`email`); |
| 41 | |
| 42 | |