| 1 | CREATE TABLE `connectors` (`id` integer PRIMARY KEY AUTOINCREMENT,`kind` text NOT NULL,`sealed_token` blob NOT NULL,`workspace_print` text,`last_verified` datetime,`created_at` datetime,`updated_at` datetime); |
| 2 | |
| 3 | CREATE UNIQUE INDEX `idx_connectors_kind` ON `connectors`(`kind`); |
| 4 | |
| 5 | CREATE TABLE `sync_runs` (`id` integer PRIMARY KEY AUTOINCREMENT,`connector_id` integer NOT NULL,`state` text NOT NULL,`roots` integer,`total` integer NOT NULL DEFAULT -1,`fetched` integer,`skipped` integer,`empty` integer,`failed_pages` integer,`unread_blocks` integer,`error_code` text,`heartbeat` datetime,`started_at` datetime,`finished_at` datetime); |
| 6 | |
| 7 | CREATE INDEX `idx_sync_runs_state` ON `sync_runs`(`state`); |
| 8 | |
| 9 | CREATE INDEX `idx_sync_runs_connector_id` ON `sync_runs`(`connector_id`); |
| 10 | |
| 11 | CREATE TABLE `source_pages` (`id` integer PRIMARY KEY AUTOINCREMENT,`connector_id` integer NOT NULL,`page_print` text NOT NULL,`sealed_page_id` blob NOT NULL,`sealed_path` blob,`path_print` text,`seen_edited` text,`ingested_edited` text,`ingested_path` text,`state` text NOT NULL DEFAULT "pending",`error_code` text,`last_seen` datetime,`document_id` integer,`created_at` datetime,`updated_at` datetime); |
| 12 | |
| 13 | CREATE INDEX `idx_source_pages_state` ON `source_pages`(`state`); |
| 14 | |
| 15 | CREATE INDEX `idx_source_pages_page_print` ON `source_pages`(`page_print`); |
| 16 | |
| 17 | CREATE INDEX `idx_source_pages_connector_id` ON `source_pages`(`connector_id`); |
| 18 | |
| 19 | |