SQL
CREATE TABLE source_cursors (
source_id TEXT NOT NULL,
cursor_key TEXT NOT NULL,
-- e.g. "gmail_history_id",
"calendar_sync_token"
cursor_value TEXT,
updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
PRIMARY KEY (source_id, cursor_key),
FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
)
Columns
| Column | Data type | Allow null | Primary key | Actions |
|---|---|---|---|---|
source_id |
TEXT |
✓ | Rename | Drop | |
cursor_key |
TEXT |
✓ | Rename | Drop | |
cursor_value |
TEXT |
✓ | Rename | Drop | |
updated_at |
TEXT |
Rename | Drop |
Foreign Keys
| Column | Destination |
|---|---|
source_id |
sources.id |
Indexes
| Name | Columns | Unique | SQL | Drop? |
|---|---|---|---|---|
| sqlite_autoindex_source_cursors_1 |
|
✓ | SQL | Drop |