Skip to content

Email for professionals and teams

Add events reminder push notification #119

Hieu Nguyen (Jack)17e57896fe40
diff --git a/CLAUDE.md b/CLAUDE.md
index c1b6d94..cc99bbf 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -151,6 +151,10 @@ The composer's bell (`FollowUpMenu`) sends `followUpDays`; `deliverEmail` arms a
Optional tables are detected with `isMissingTableError` (`src/lib/database-errors.ts`): drizzle rethrows driver errors as "Failed query" with the SQLite message on `cause`, so matching `String(error)` misses it.
+### Calendar reminders are Web Push from the five-minute cron
+
+`calendar_events.reminder_minutes` (null = none, 0-10080) is set in the event editor. `runCalendarReminders` (`src/lib/calendar/reminders.ts`, in `worker.ts` `scheduled()` and the Node scheduler) expands each event with `expandToolEvents` and pushes every occurrence whose start minus the offset has passed and that has not started. `last_reminded_start` is claimed with a conditional update before sending, so overlapping runs never notify twice; editing an event resets it. Delivery is `sendPushContent` (`src/lib/push/server.ts`), the generic form that `sendPushNotifications` now wraps; native APNs push is not wired to reminders. Before migration 0078 the cron does nothing (`isMissingColumnError`).
+
### Imports are background jobs
`/api/import/messages` (uploads) and `/api/import/imap` only validate and create a row in `import_jobs`, then answer 202 with the job; nothing is imported inside the request. `processImportJob` (`src/lib/import/jobs.ts`) handles one chunk per `import.run` message on `OUTBOUND_QUEUE` (like webhook retries, so no extra binding), records counters and the resume `cursor` on the row, and enqueues the next chunk itself. Uploaded files are split and staged in the bucket as `import-jobs/<id>/<n>.bin` batches (`staging.ts`), deleted as consumed. IMAP jobs read the folder list from `spec`, but the password never touches the database: it rides along in each queue message, so a lost message fails the job instead of resuming. Cancelling flips the status; every chunk's final write is conditional on the job still being active. `sweepImportJobs` (cron / Node scheduler) fails jobs idle for 30 minutes and prunes finished records after 7 days. The import page polls `GET /api/import/jobs`; `DELETE /api/import/jobs/[id]` cancels an active job or dismisses a finished one. IMAP chunks pipeline their FETCHes (sizes first via `RFC822.SIZE`, then groups bounded by `planImapFetchGroups`). Chunk size is adaptive: `cursor.size` halves when a chunk throws (retried up to 4 times, except credential errors) or when the queue redelivers the message (`attempt` from `msg.attempts`, e.g. a resource-limit 503), and climbs back after clean chunks. `import_jobs` is in `INTERNAL_TABLES`, so backups skip it.
diff --git a/drizzle/migrations-mysql/0002_calendar_reminders.sql b/drizzle/migrations-mysql/0002_calendar_reminders.sql
new file mode 100644
index 0000000..edfe5fa
--- /dev/null
+++ b/drizzle/migrations-mysql/0002_calendar_reminders.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `calendar_events` ADD `reminder_minutes` bigint;--> statement-breakpoint
+ALTER TABLE `calendar_events` ADD `last_reminded_start` bigint;
\ No newline at end of file
diff --git a/drizzle/migrations-mysql/meta/0002_snapshot.json b/drizzle/migrations-mysql/meta/0002_snapshot.json
new file mode 100644
index 0000000..4ca3c72
--- /dev/null
+++ b/drizzle/migrations-mysql/meta/0002_snapshot.json
@@ -0,0 +1,6467 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "362f2720-de98-432d-8477-05bc5320dd5e",
+ "prevId": "b80e3d7b-c8bf-4112-902d-4e95811a12fb",
+ "tables": {
+ "agent_chat_messages": {
+ "name": "agent_chat_messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tool_name": {
+ "name": "tool_name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "agent_chat_messages_conversation_idx": {
+ "name": "agent_chat_messages_conversation_idx",
+ "columns": [
+ "conversation_id",
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "agent_chat_messages_conversation_id_agent_conversations_id_fk": {
+ "name": "agent_chat_messages_conversation_id_agent_conversations_id_fk",
+ "tableFrom": "agent_chat_messages",
+ "tableTo": "agent_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "agent_chat_messages_id": {
+ "name": "agent_chat_messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "agent_conversations": {
+ "name": "agent_conversations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('New conversation')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "agent_conversations_owner_idx": {
+ "name": "agent_conversations_owner_idx",
+ "columns": [
+ "user_id",
+ "mailbox_id",
+ "updated_at"
+ ],
+ "isUnique": false
+ },
+ "agent_conversations_mailbox_idx": {
+ "name": "agent_conversations_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "agent_conversations_user_id_users_id_fk": {
+ "name": "agent_conversations_user_id_users_id_fk",
+ "tableFrom": "agent_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_conversations_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_conversations_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_conversations",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "agent_conversations_id": {
+ "name": "agent_conversations_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "agent_draft_metadata": {
+ "name": "agent_draft_metadata",
+ "columns": {
+ "draft_id": {
+ "name": "draft_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "origin": {
+ "name": "origin",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "human_edited_at": {
+ "name": "human_edited_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scheduled_at": {
+ "name": "scheduled_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "agent_draft_meta_source_msg_idx": {
+ "name": "agent_draft_meta_source_msg_idx",
+ "columns": [
+ "source_message_id"
+ ],
+ "isUnique": false
+ },
+ "agent_draft_metadata_mailbox_idx": {
+ "name": "agent_draft_metadata_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "agent_draft_metadata_draft_id_messages_id_fk": {
+ "name": "agent_draft_metadata_draft_id_messages_id_fk",
+ "tableFrom": "agent_draft_metadata",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "draft_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_draft_metadata_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_draft_metadata_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_draft_metadata",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_draft_metadata_source_message_id_messages_id_fk": {
+ "name": "agent_draft_metadata_source_message_id_messages_id_fk",
+ "tableFrom": "agent_draft_metadata",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "source_message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "agent_draft_metadata_draft_id": {
+ "name": "agent_draft_metadata_draft_id",
+ "columns": [
+ "draft_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "agent_jobs": {
+ "name": "agent_jobs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "next_attempt_at": {
+ "name": "next_attempt_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "reason": {
+ "name": "reason",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "agent_jobs_source_idx": {
+ "name": "agent_jobs_source_idx",
+ "columns": [
+ "mailbox_id",
+ "source_message_id"
+ ],
+ "isUnique": true
+ },
+ "agent_jobs_due_idx": {
+ "name": "agent_jobs_due_idx",
+ "columns": [
+ "status",
+ "next_attempt_at"
+ ],
+ "isUnique": false
+ },
+ "agent_jobs_source_message_idx": {
+ "name": "agent_jobs_source_message_idx",
+ "columns": [
+ "source_message_id"
+ ],
+ "isUnique": false
+ },
+ "agent_jobs_draft_idx": {
+ "name": "agent_jobs_draft_idx",
+ "columns": [
+ "draft_id"
+ ],
+ "isUnique": false
+ },
+ "agent_jobs_reviewer_idx": {
+ "name": "agent_jobs_reviewer_idx",
+ "columns": [
+ "reviewer_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "agent_jobs_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_jobs_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_jobs_source_message_id_messages_id_fk": {
+ "name": "agent_jobs_source_message_id_messages_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "source_message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_jobs_reviewer_user_id_users_id_fk": {
+ "name": "agent_jobs_reviewer_user_id_users_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "reviewer_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_jobs_draft_id_messages_id_fk": {
+ "name": "agent_jobs_draft_id_messages_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "draft_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "agent_jobs_id": {
+ "name": "agent_jobs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "agent_send_approvals": {
+ "name": "agent_send_approvals",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "request_key_id": {
+ "name": "request_key_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "payload_hash": {
+ "name": "payload_hash",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "claimed_at": {
+ "name": "claimed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "agent_send_approvals_user_idx": {
+ "name": "agent_send_approvals_user_idx",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ },
+ "agent_send_approvals_delivery_idx": {
+ "name": "agent_send_approvals_delivery_idx",
+ "columns": [
+ "draft_id"
+ ],
+ "isUnique": false
+ },
+ "agent_send_approvals_request_key_idx": {
+ "name": "agent_send_approvals_request_key_idx",
+ "columns": [
+ "request_key_id"
+ ],
+ "isUnique": false
+ },
+ "agent_send_approvals_mailbox_idx": {
+ "name": "agent_send_approvals_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "agent_send_approvals_draft_idx": {
+ "name": "agent_send_approvals_draft_idx",
+ "columns": [
+ "draft_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "agent_send_approvals_draft_id_messages_id_fk": {
+ "name": "agent_send_approvals_draft_id_messages_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "draft_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_send_approvals_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_send_approvals_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_send_approvals_user_id_users_id_fk": {
+ "name": "agent_send_approvals_user_id_users_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_send_approvals_request_key_id_api_keys_id_fk": {
+ "name": "agent_send_approvals_request_key_id_api_keys_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "api_keys",
+ "columnsFrom": [
+ "request_key_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "agent_send_approvals_id": {
+ "name": "agent_send_approvals_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "ai_usage": {
+ "name": "ai_usage",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider": {
+ "name": "provider",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "model": {
+ "name": "model",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "input_tokens": {
+ "name": "input_tokens",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "output_tokens": {
+ "name": "output_tokens",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "cost_usd_micros": {
+ "name": "cost_usd_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "ai_usage_created_idx": {
+ "name": "ai_usage_created_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "ai_usage_id": {
+ "name": "ai_usage_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "api_keys": {
+ "name": "api_keys",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'legacy'"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_scope_enabled": {
+ "name": "mailbox_scope_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "api_keys_user_idx": {
+ "name": "api_keys_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "api_keys_id": {
+ "name": "api_keys_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "app_settings": {
+ "name": "app_settings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "app_name": {
+ "name": "app_name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('Mailflare')"
+ },
+ "outbound_attachment_max_mb": {
+ "name": "outbound_attachment_max_mb",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 25
+ },
+ "drive_storage_limit_bytes": {
+ "name": "drive_storage_limit_bytes",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resend_api_key": {
+ "name": "resend_api_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "aws_config": {
+ "name": "aws_config",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ses_receiving": {
+ "name": "ses_receiving",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resend_webhook_id": {
+ "name": "resend_webhook_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resend_webhook_secret": {
+ "name": "resend_webhook_secret",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "icon_key": {
+ "name": "icon_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "agent_enabled": {
+ "name": "agent_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "agent_provider": {
+ "name": "agent_provider",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "agent_preset": {
+ "name": "agent_preset",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "agent_base_url": {
+ "name": "agent_base_url",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "agent_api_key": {
+ "name": "agent_api_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "agent_model": {
+ "name": "agent_model",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "agent_model_rates": {
+ "name": "agent_model_rates",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spamhaus_dqs_key": {
+ "name": "spamhaus_dqs_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "abusech_auth_key": {
+ "name": "abusech_auth_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spam_domain_age_check": {
+ "name": "spam_domain_age_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "spam_brands": {
+ "name": "spam_brands",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "app_settings_id": {
+ "name": "app_settings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "audit_logs": {
+ "name": "audit_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "actor_user_id": {
+ "name": "actor_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_idx": {
+ "name": "audit_logs_actor_idx",
+ "columns": [
+ "actor_user_id"
+ ],
+ "isUnique": false
+ },
+ "audit_logs_mailbox_idx": {
+ "name": "audit_logs_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "audit_logs_created_idx": {
+ "name": "audit_logs_created_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "audit_logs_message_id_idx": {
+ "name": "audit_logs_message_id_idx",
+ "columns": [
+ "message_id"
+ ],
+ "isUnique": false
+ },
+ "audit_logs_target_user_idx": {
+ "name": "audit_logs_target_user_idx",
+ "columns": [
+ "target_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_user_id_users_id_fk": {
+ "name": "audit_logs_actor_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "actor_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "audit_logs_target_user_id_users_id_fk": {
+ "name": "audit_logs_target_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "audit_logs_mailbox_id_mailboxes_id_fk": {
+ "name": "audit_logs_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "audit_logs_message_id_messages_id_fk": {
+ "name": "audit_logs_message_id_messages_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "audit_logs_id": {
+ "name": "audit_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "auto_reply_deliveries": {
+ "name": "auto_reply_deliveries",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "recipient": {
+ "name": "recipient",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "sent_at": {
+ "name": "sent_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "auto_reply_deliveries_mailbox_recipient_idx": {
+ "name": "auto_reply_deliveries_mailbox_recipient_idx",
+ "columns": [
+ "mailbox_id",
+ "recipient"
+ ],
+ "isUnique": true
+ },
+ "auto_reply_deliveries_sent_idx": {
+ "name": "auto_reply_deliveries_sent_idx",
+ "columns": [
+ "sent_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "auto_reply_deliveries_mailbox_id_mailboxes_id_fk": {
+ "name": "auto_reply_deliveries_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "auto_reply_deliveries",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "auto_reply_deliveries_id": {
+ "name": "auto_reply_deliveries_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "backup_settings": {
+ "name": "backup_settings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "schedule_type": {
+ "name": "schedule_type",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'daily'"
+ },
+ "schedule_value": {
+ "name": "schedule_value",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "retention_enabled": {
+ "name": "retention_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "retention_days": {
+ "name": "retention_days",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 30
+ },
+ "excluded_table_groups": {
+ "name": "excluded_table_groups",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "backup_settings_id": {
+ "name": "backup_settings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "backups": {
+ "name": "backups",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'queued'"
+ },
+ "trigger": {
+ "name": "trigger",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "r2_key": {
+ "name": "r2_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "filename": {
+ "name": "filename",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "size": {
+ "name": "size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "backups_created_idx": {
+ "name": "backups_created_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "backups_status_idx": {
+ "name": "backups_status_idx",
+ "columns": [
+ "status"
+ ],
+ "isUnique": false
+ },
+ "backups_created_by_idx": {
+ "name": "backups_created_by_idx",
+ "columns": [
+ "created_by_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "backups_created_by_user_id_users_id_fk": {
+ "name": "backups_created_by_user_id_users_id_fk",
+ "tableFrom": "backups",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "backups_id": {
+ "name": "backups_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "booking_events": {
+ "name": "booking_events",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "slug": {
+ "name": "slug",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "description": {
+ "name": "description",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "color": {
+ "name": "color",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('#2563eb')"
+ },
+ "host_ids": {
+ "name": "host_ids",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "duration_minutes": {
+ "name": "duration_minutes",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "location": {
+ "name": "location",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "weekdays": {
+ "name": "weekdays",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[1,2,3,4,5]')"
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('09:00')"
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('17:00')"
+ },
+ "time_ranges": {
+ "name": "time_ranges",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[{\"startTime\":\"09:00\",\"endTime\":\"17:00\"}]')"
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('UTC')"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "booking_events_user_idx": {
+ "name": "booking_events_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "booking_events_user_slug_idx": {
+ "name": "booking_events_user_slug_idx",
+ "columns": [
+ "user_id",
+ "slug"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "booking_events_user_id_users_id_fk": {
+ "name": "booking_events_user_id_users_id_fk",
+ "tableFrom": "booking_events",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "booking_events_id": {
+ "name": "booking_events_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "calendar_events": {
+ "name": "calendar_events",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "location": {
+ "name": "location",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "attendees": {
+ "name": "attendees",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "color": {
+ "name": "color",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('blue')"
+ },
+ "repeat": {
+ "name": "repeat",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'none'"
+ },
+ "repeat_days": {
+ "name": "repeat_days",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "repeat_anchor_day": {
+ "name": "repeat_anchor_day",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "repeat_until": {
+ "name": "repeat_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "excluded_occurrences": {
+ "name": "excluded_occurrences",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "starts_at": {
+ "name": "starts_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "ends_at": {
+ "name": "ends_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reminder_minutes": {
+ "name": "reminder_minutes",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_reminded_start": {
+ "name": "last_reminded_start",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "calendar_events_user_starts_idx": {
+ "name": "calendar_events_user_starts_idx",
+ "columns": [
+ "user_id",
+ "starts_at"
+ ],
+ "isUnique": false
+ },
+ "calendar_events_mailbox_idx": {
+ "name": "calendar_events_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "calendar_events_user_id_users_id_fk": {
+ "name": "calendar_events_user_id_users_id_fk",
+ "tableFrom": "calendar_events",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "calendar_events_mailbox_id_mailboxes_id_fk": {
+ "name": "calendar_events_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "calendar_events",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "calendar_events_id": {
+ "name": "calendar_events_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "contacts": {
+ "name": "contacts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "avatar_key": {
+ "name": "avatar_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "source": {
+ "name": "source",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'inbound'"
+ },
+ "blocked": {
+ "name": "blocked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "remote_content_allowed": {
+ "name": "remote_content_allowed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "contacts_user_email_idx": {
+ "name": "contacts_user_email_idx",
+ "columns": [
+ "user_id",
+ "email"
+ ],
+ "isUnique": true
+ },
+ "contacts_user_idx": {
+ "name": "contacts_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "contacts_user_id_users_id_fk": {
+ "name": "contacts_user_id_users_id_fk",
+ "tableFrom": "contacts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "contacts_id": {
+ "name": "contacts_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "domain_tracking_hosts": {
+ "name": "domain_tracking_hosts",
+ "columns": {
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "domain_tracking_hosts_hostname_idx": {
+ "name": "domain_tracking_hosts_hostname_idx",
+ "columns": [
+ "hostname"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "domain_tracking_hosts_domain_id_domains_id_fk": {
+ "name": "domain_tracking_hosts_domain_id_domains_id_fk",
+ "tableFrom": "domain_tracking_hosts",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "domain_tracking_hosts_domain_id": {
+ "name": "domain_tracking_hosts_domain_id",
+ "columns": [
+ "domain_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "domains": {
+ "name": "domains",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "zone_id": {
+ "name": "zone_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "routing_status": {
+ "name": "routing_status",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sending_subdomain_tag": {
+ "name": "sending_subdomain_tag",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "sending_provider": {
+ "name": "sending_provider",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'none'"
+ },
+ "receiving_provider": {
+ "name": "receiving_provider",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'cloudflare'"
+ },
+ "sending_requested": {
+ "name": "sending_requested",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "sending_enabled": {
+ "name": "sending_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "routing_enabled": {
+ "name": "routing_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "dns_skipped": {
+ "name": "dns_skipped",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "domains_hostname_idx": {
+ "name": "domains_hostname_idx",
+ "columns": [
+ "hostname"
+ ],
+ "isUnique": true
+ },
+ "domains_user_idx": {
+ "name": "domains_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "domains_user_id_users_id_fk": {
+ "name": "domains_user_id_users_id_fk",
+ "tableFrom": "domains",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "domains_id": {
+ "name": "domains_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "drive_items": {
+ "name": "drive_items",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "r2_key": {
+ "name": "r2_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "size": {
+ "name": "size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('application/octet-stream')"
+ },
+ "upload_id": {
+ "name": "upload_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "upload_part_size": {
+ "name": "upload_part_size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "upload_fingerprint": {
+ "name": "upload_fingerprint",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "trashed_at": {
+ "name": "trashed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "drive_items_owner_parent_idx": {
+ "name": "drive_items_owner_parent_idx",
+ "columns": [
+ "owner_id",
+ "parent_id"
+ ],
+ "isUnique": false
+ },
+ "drive_items_link_token_idx": {
+ "name": "drive_items_link_token_idx",
+ "columns": [
+ "link_token"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "drive_items_owner_id_users_id_fk": {
+ "name": "drive_items_owner_id_users_id_fk",
+ "tableFrom": "drive_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "drive_items_id": {
+ "name": "drive_items_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "drive_shares": {
+ "name": "drive_shares",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "item_id": {
+ "name": "item_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'view'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "drive_shares_item_user_idx": {
+ "name": "drive_shares_item_user_idx",
+ "columns": [
+ "item_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "drive_shares_user_idx": {
+ "name": "drive_shares_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "drive_shares_item_id_drive_items_id_fk": {
+ "name": "drive_shares_item_id_drive_items_id_fk",
+ "tableFrom": "drive_shares",
+ "tableTo": "drive_items",
+ "columnsFrom": [
+ "item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "drive_shares_user_id_users_id_fk": {
+ "name": "drive_shares_user_id_users_id_fk",
+ "tableFrom": "drive_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "drive_shares_id": {
+ "name": "drive_shares_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "drive_upload_parts": {
+ "name": "drive_upload_parts",
+ "columns": {
+ "item_id": {
+ "name": "item_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "part_number": {
+ "name": "part_number",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "etag": {
+ "name": "etag",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "drive_upload_parts_idx": {
+ "name": "drive_upload_parts_idx",
+ "columns": [
+ "item_id",
+ "part_number"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "drive_upload_parts_item_id_drive_items_id_fk": {
+ "name": "drive_upload_parts_item_id_drive_items_id_fk",
+ "tableFrom": "drive_upload_parts",
+ "tableTo": "drive_items",
+ "columnsFrom": [
+ "item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "email_templates": {
+ "name": "email_templates",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "subject": {
+ "name": "subject",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "text_body": {
+ "name": "text_body",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "email_templates_user_idx": {
+ "name": "email_templates_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "email_templates_user_id_users_id_fk": {
+ "name": "email_templates_user_id_users_id_fk",
+ "tableFrom": "email_templates",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "email_templates_id": {
+ "name": "email_templates_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "folders": {
+ "name": "folders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('#2563eb')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "folders_mailbox_name_idx": {
+ "name": "folders_mailbox_name_idx",
+ "columns": [
+ "mailbox_id",
+ "name"
+ ],
+ "isUnique": true
+ },
+ "folders_user_idx": {
+ "name": "folders_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "folders_mailbox_idx": {
+ "name": "folders_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "folders_user_id_users_id_fk": {
+ "name": "folders_user_id_users_id_fk",
+ "tableFrom": "folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folders_mailbox_id_mailboxes_id_fk": {
+ "name": "folders_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "folders",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "folders_id": {
+ "name": "folders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "follow_ups": {
+ "name": "follow_ups",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "due_at": {
+ "name": "due_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "follow_ups_message_idx": {
+ "name": "follow_ups_message_idx",
+ "columns": [
+ "message_id"
+ ],
+ "isUnique": true
+ },
+ "follow_ups_status_due_idx": {
+ "name": "follow_ups_status_due_idx",
+ "columns": [
+ "status",
+ "due_at"
+ ],
+ "isUnique": false
+ },
+ "follow_ups_user_status_idx": {
+ "name": "follow_ups_user_status_idx",
+ "columns": [
+ "user_id",
+ "status"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "follow_ups_message_id_messages_id_fk": {
+ "name": "follow_ups_message_id_messages_id_fk",
+ "tableFrom": "follow_ups",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "follow_ups_user_id_users_id_fk": {
+ "name": "follow_ups_user_id_users_id_fk",
+ "tableFrom": "follow_ups",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "follow_ups_id": {
+ "name": "follow_ups_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "import_jobs": {
+ "name": "import_jobs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'queued'"
+ },
+ "total": {
+ "name": "total",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "processed": {
+ "name": "processed",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "imported": {
+ "name": "imported",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "skipped": {
+ "name": "skipped",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "spec": {
+ "name": "spec",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cursor": {
+ "name": "cursor",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('{}')"
+ },
+ "errors": {
+ "name": "errors",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "error_count": {
+ "name": "error_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "error": {
+ "name": "error",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "import_jobs_user_idx": {
+ "name": "import_jobs_user_idx",
+ "columns": [
+ "user_id",
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "import_jobs_status_idx": {
+ "name": "import_jobs_status_idx",
+ "columns": [
+ "status",
+ "updated_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "import_jobs_user_id_users_id_fk": {
+ "name": "import_jobs_user_id_users_id_fk",
+ "tableFrom": "import_jobs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "import_jobs_mailbox_id_mailboxes_id_fk": {
+ "name": "import_jobs_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "import_jobs",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "import_jobs_id": {
+ "name": "import_jobs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "jmap_change_floor": {
+ "name": "jmap_change_floor",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "seq": {
+ "name": "seq",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "jmap_change_floor_id": {
+ "name": "jmap_change_floor_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "jmap_changes": {
+ "name": "jmap_changes",
+ "columns": {
+ "seq": {
+ "name": "seq",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "object_type": {
+ "name": "object_type",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "object_id": {
+ "name": "object_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "change": {
+ "name": "change",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(unix_timestamp())"
+ }
+ },
+ "indexes": {
+ "jmap_changes_mailbox_seq_idx": {
+ "name": "jmap_changes_mailbox_seq_idx",
+ "columns": [
+ "mailbox_id",
+ "seq"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "jmap_changes_seq": {
+ "name": "jmap_changes_seq",
+ "columns": [
+ "seq"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "jmap_mailbox_revisions": {
+ "name": "jmap_mailbox_revisions",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "jmap_mailbox_revisions_mailbox_id": {
+ "name": "jmap_mailbox_revisions_mailbox_id",
+ "columns": [
+ "mailbox_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "license_settings": {
+ "name": "license_settings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "instance_id": {
+ "name": "instance_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "instance_url": {
+ "name": "instance_url",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "license_key_hash": {
+ "name": "license_key_hash",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "plan": {
+ "name": "plan",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'community'"
+ },
+ "state": {
+ "name": "state",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'inactive'"
+ },
+ "features": {
+ "name": "features",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('[]')"
+ },
+ "seat_limit": {
+ "name": "seat_limit",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 1
+ },
+ "activated_at": {
+ "name": "activated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "validated_at": {
+ "name": "validated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "license_settings_id": {
+ "name": "license_settings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "license_settings_instance_id_unique": {
+ "name": "license_settings_instance_id_unique",
+ "columns": [
+ "instance_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "login_challenges": {
+ "name": "login_challenges",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "login_challenges_user_idx": {
+ "name": "login_challenges_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "login_challenges_user_id_users_id_fk": {
+ "name": "login_challenges_user_id_users_id_fk",
+ "tableFrom": "login_challenges",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "login_challenges_id": {
+ "name": "login_challenges_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "login_challenges_token_hash_unique": {
+ "name": "login_challenges_token_hash_unique",
+ "columns": [
+ "token_hash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "mailbox_access": {
+ "name": "mailbox_access",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "permission": {
+ "name": "permission",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'read_only'"
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "mailbox_access_mailbox_user_idx": {
+ "name": "mailbox_access_mailbox_user_idx",
+ "columns": [
+ "mailbox_id",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "mailbox_access_user_idx": {
+ "name": "mailbox_access_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "mailbox_access_mailbox_idx": {
+ "name": "mailbox_access_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "mailbox_access_created_by_idx": {
+ "name": "mailbox_access_created_by_idx",
+ "columns": [
+ "created_by_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "mailbox_access_mailbox_id_mailboxes_id_fk": {
+ "name": "mailbox_access_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mailbox_access",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_access_user_id_users_id_fk": {
+ "name": "mailbox_access_user_id_users_id_fk",
+ "tableFrom": "mailbox_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_access_created_by_user_id_users_id_fk": {
+ "name": "mailbox_access_created_by_user_id_users_id_fk",
+ "tableFrom": "mailbox_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "mailbox_access_id": {
+ "name": "mailbox_access_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "mailbox_agent_settings": {
+ "name": "mailbox_agent_settings",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "model_id": {
+ "name": "model_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auto_draft_enabled": {
+ "name": "auto_draft_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "instructions": {
+ "name": "instructions",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "daily_limit": {
+ "name": "daily_limit",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 25
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "mailbox_agent_settings_reviewer_idx": {
+ "name": "mailbox_agent_settings_reviewer_idx",
+ "columns": [
+ "reviewer_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "mailbox_agent_settings_mailbox_id_mailboxes_id_fk": {
+ "name": "mailbox_agent_settings_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mailbox_agent_settings",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_agent_settings_reviewer_user_id_users_id_fk": {
+ "name": "mailbox_agent_settings_reviewer_user_id_users_id_fk",
+ "tableFrom": "mailbox_agent_settings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "reviewer_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "mailbox_agent_settings_mailbox_id": {
+ "name": "mailbox_agent_settings_mailbox_id",
+ "columns": [
+ "mailbox_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "mailbox_aliases": {
+ "name": "mailbox_aliases",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "local_part": {
+ "name": "local_part",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "mailbox_aliases_address_idx": {
+ "name": "mailbox_aliases_address_idx",
+ "columns": [
+ "domain_id",
+ "local_part"
+ ],
+ "isUnique": true
+ },
+ "mailbox_aliases_mailbox_idx": {
+ "name": "mailbox_aliases_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "mailbox_aliases_mailbox_id_mailboxes_id_fk": {
+ "name": "mailbox_aliases_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mailbox_aliases",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_aliases_domain_id_domains_id_fk": {
+ "name": "mailbox_aliases_domain_id_domains_id_fk",
+ "tableFrom": "mailbox_aliases",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "mailbox_aliases_id": {
+ "name": "mailbox_aliases_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "mailboxes": {
+ "name": "mailboxes",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "local_part": {
+ "name": "local_part",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "signature": {
+ "name": "signature",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auto_reply_enabled": {
+ "name": "auto_reply_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "auto_reply_subject": {
+ "name": "auto_reply_subject",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('Out of office')"
+ },
+ "auto_reply_body": {
+ "name": "auto_reply_body",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "avatar_key": {
+ "name": "avatar_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'personal'"
+ },
+ "use_all_domains": {
+ "name": "use_all_domains",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "disabled": {
+ "name": "disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "mailboxes_address_idx": {
+ "name": "mailboxes_address_idx",
+ "columns": [
+ "domain_id",
+ "local_part"
+ ],
+ "isUnique": true
+ },
+ "mailboxes_user_idx": {
+ "name": "mailboxes_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "mailboxes_user_id_users_id_fk": {
+ "name": "mailboxes_user_id_users_id_fk",
+ "tableFrom": "mailboxes",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailboxes_domain_id_domains_id_fk": {
+ "name": "mailboxes_domain_id_domains_id_fk",
+ "tableFrom": "mailboxes",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "mailboxes_id": {
+ "name": "mailboxes_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "mcp_key_mailboxes": {
+ "name": "mcp_key_mailboxes",
+ "columns": {
+ "key_id": {
+ "name": "key_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "mcp_key_mailbox_idx": {
+ "name": "mcp_key_mailbox_idx",
+ "columns": [
+ "key_id",
+ "mailbox_id"
+ ],
+ "isUnique": true
+ },
+ "mcp_key_mailboxes_mailbox_idx": {
+ "name": "mcp_key_mailboxes_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "mcp_key_mailboxes_key_id_api_keys_id_fk": {
+ "name": "mcp_key_mailboxes_key_id_api_keys_id_fk",
+ "tableFrom": "mcp_key_mailboxes",
+ "tableTo": "api_keys",
+ "columnsFrom": [
+ "key_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mcp_key_mailboxes_mailbox_id_mailboxes_id_fk": {
+ "name": "mcp_key_mailboxes_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mcp_key_mailboxes",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "message_attachments": {
+ "name": "message_attachments",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "filename": {
+ "name": "filename",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "size": {
+ "name": "size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "disposition": {
+ "name": "disposition",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'attachment'"
+ },
+ "content_id": {
+ "name": "content_id",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "r2_key": {
+ "name": "r2_key",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "trashed_at": {
+ "name": "trashed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "message_attachments_message_idx": {
+ "name": "message_attachments_message_idx",
+ "columns": [
+ "message_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "message_attachments_message_id_messages_id_fk": {
+ "name": "message_attachments_message_id_messages_id_fk",
+ "tableFrom": "message_attachments",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "message_attachments_id": {
+ "name": "message_attachments_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "message_attachments_r2_key_unique": {
+ "name": "message_attachments_r2_key_unique",
+ "columns": [
+ "r2_key"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "message_opens": {
+ "name": "message_opens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "opened_at": {
+ "name": "opened_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "client": {
+ "name": "client",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "device": {
+ "name": "device",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "country": {
+ "name": "country",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "city": {
+ "name": "city",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "automated": {
+ "name": "automated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ }
+ },
+ "indexes": {
+ "message_opens_token_idx": {
+ "name": "message_opens_token_idx",
+ "columns": [
+ "token",
+ "opened_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "message_opens_token_message_tracking_token_fk": {
+ "name": "message_opens_token_message_tracking_token_fk",
+ "tableFrom": "message_opens",
+ "tableTo": "message_tracking",
+ "columnsFrom": [
+ "token"
+ ],
+ "columnsTo": [
+ "token"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "message_opens_id": {
+ "name": "message_opens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "message_tracking": {
+ "name": "message_tracking",
+ "columns": {
+ "token": {
+ "name": "token",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "open_count": {
+ "name": "open_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "first_opened_at": {
+ "name": "first_opened_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_opened_at": {
+ "name": "last_opened_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "message_tracking_message_idx": {
+ "name": "message_tracking_message_idx",
+ "columns": [
+ "message_id"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "message_tracking_message_id_messages_id_fk": {
+ "name": "message_tracking_message_id_messages_id_fk",
+ "tableFrom": "message_tracking",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "message_tracking_token": {
+ "name": "message_tracking_token",
+ "columns": [
+ "token"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "messages": {
+ "name": "messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "direction": {
+ "name": "direction",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_message_id": {
+ "name": "provider_message_id",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "from_addr": {
+ "name": "from_addr",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "to_addr": {
+ "name": "to_addr",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "cc_addr": {
+ "name": "cc_addr",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "bcc_addr": {
+ "name": "bcc_addr",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "reply_to": {
+ "name": "reply_to",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "subject": {
+ "name": "subject",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "snippet": {
+ "name": "snippet",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "text_body": {
+ "name": "text_body",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "html_body": {
+ "name": "html_body",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "raw_r2_key": {
+ "name": "raw_r2_key",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'received'"
+ },
+ "read": {
+ "name": "read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "starred": {
+ "name": "starred",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "snoozed_until": {
+ "name": "snoozed_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "in_reply_to": {
+ "name": "in_reply_to",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "references_header": {
+ "name": "references_header",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spam_score": {
+ "name": "spam_score",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spam_verdict": {
+ "name": "spam_verdict",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spam_signals": {
+ "name": "spam_signals",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spam_analyzed_at": {
+ "name": "spam_analyzed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "spam_analysis_error": {
+ "name": "spam_analysis_error",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "trashed_at": {
+ "name": "trashed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "messages_user_created_idx": {
+ "name": "messages_user_created_idx",
+ "columns": [
+ "user_id",
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "messages_mailbox_idx": {
+ "name": "messages_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "messages_folder_idx": {
+ "name": "messages_folder_idx",
+ "columns": [
+ "folder_id"
+ ],
+ "isUnique": false
+ },
+ "messages_thread_idx": {
+ "name": "messages_thread_idx",
+ "columns": [
+ "mailbox_id",
+ "thread_id"
+ ],
+ "isUnique": false
+ },
+ "messages_provider_message_idx": {
+ "name": "messages_provider_message_idx",
+ "columns": [
+ "mailbox_id",
+ "provider_message_id"
+ ],
+ "isUnique": false
+ },
+ "messages_raw_r2_key_idx": {
+ "name": "messages_raw_r2_key_idx",
+ "columns": [
+ "raw_r2_key"
+ ],
+ "isUnique": false
+ },
+ "messages_trashed_at_idx": {
+ "name": "messages_trashed_at_idx",
+ "columns": [
+ "trashed_at"
+ ],
+ "isUnique": false
+ },
+ "messages_inbox_page_idx": {
+ "name": "messages_inbox_page_idx",
+ "columns": [
+ "mailbox_id",
+ "status",
+ "folder_id",
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "messages_thread_key_idx": {
+ "name": "messages_thread_key_idx",
+ "columns": [
+ "mailbox_id",
+ "status",
+ "folder_id",
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "messages_mailbox_thread_key_idx": {
+ "name": "messages_mailbox_thread_key_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "messages_nav_cover_idx": {
+ "name": "messages_nav_cover_idx",
+ "columns": [
+ "mailbox_id",
+ "status",
+ "folder_id",
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "messages_counts_cover_idx": {
+ "name": "messages_counts_cover_idx",
+ "columns": [
+ "mailbox_id",
+ "folder_id",
+ "direction",
+ "status",
+ "read",
+ "starred",
+ "snoozed_until"
+ ],
+ "isUnique": false
+ },
+ "messages_conv_cover_idx": {
+ "name": "messages_conv_cover_idx",
+ "columns": [
+ "mailbox_id",
+ "status",
+ "created_at",
+ "id",
+ "snoozed_until"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "messages_user_id_users_id_fk": {
+ "name": "messages_user_id_users_id_fk",
+ "tableFrom": "messages",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "messages_mailbox_id_mailboxes_id_fk": {
+ "name": "messages_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "messages",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "messages_folder_id_folders_id_fk": {
+ "name": "messages_folder_id_folders_id_fk",
+ "tableFrom": "messages",
+ "tableTo": "folders",
+ "columnsFrom": [
+ "folder_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "messages_id": {
+ "name": "messages_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "mfa_recovery_codes": {
+ "name": "mfa_recovery_codes",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "mfa_recovery_codes_user_idx": {
+ "name": "mfa_recovery_codes_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "mfa_recovery_codes_user_id_users_id_fk": {
+ "name": "mfa_recovery_codes_user_id_users_id_fk",
+ "tableFrom": "mfa_recovery_codes",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "mfa_recovery_codes_id": {
+ "name": "mfa_recovery_codes_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "mfa_recovery_codes_code_hash_unique": {
+ "name": "mfa_recovery_codes_code_hash_unique",
+ "columns": [
+ "code_hash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "outbound_jobs": {
+ "name": "outbound_jobs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'queued'"
+ },
+ "payload": {
+ "name": "payload",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scheduled_at": {
+ "name": "scheduled_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "outbound_jobs_user_idx": {
+ "name": "outbound_jobs_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "outbound_jobs_message_idx": {
+ "name": "outbound_jobs_message_idx",
+ "columns": [
+ "message_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "outbound_jobs_user_id_users_id_fk": {
+ "name": "outbound_jobs_user_id_users_id_fk",
+ "tableFrom": "outbound_jobs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "outbound_jobs_message_id_messages_id_fk": {
+ "name": "outbound_jobs_message_id_messages_id_fk",
+ "tableFrom": "outbound_jobs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "outbound_jobs_id": {
+ "name": "outbound_jobs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "password_reset_tokens": {
+ "name": "password_reset_tokens",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "password_reset_tokens_user_idx": {
+ "name": "password_reset_tokens_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "password_reset_tokens_user_id_users_id_fk": {
+ "name": "password_reset_tokens_user_id_users_id_fk",
+ "tableFrom": "password_reset_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "password_reset_tokens_id": {
+ "name": "password_reset_tokens_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "password_reset_tokens_token_hash_unique": {
+ "name": "password_reset_tokens_token_hash_unique",
+ "columns": [
+ "token_hash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "push_devices": {
+ "name": "push_devices",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "api_key_id": {
+ "name": "api_key_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "platform": {
+ "name": "platform",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "environment": {
+ "name": "environment",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'production'"
+ },
+ "topic": {
+ "name": "topic",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "previews": {
+ "name": "previews",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "client_ref": {
+ "name": "client_ref",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "push_devices_platform_token_user_idx": {
+ "name": "push_devices_platform_token_user_idx",
+ "columns": [
+ "platform",
+ "token",
+ "user_id"
+ ],
+ "isUnique": true
+ },
+ "push_devices_user_idx": {
+ "name": "push_devices_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "push_devices_api_key_idx": {
+ "name": "push_devices_api_key_idx",
+ "columns": [
+ "api_key_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "push_devices_user_id_users_id_fk": {
+ "name": "push_devices_user_id_users_id_fk",
+ "tableFrom": "push_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "push_devices_api_key_id_api_keys_id_fk": {
+ "name": "push_devices_api_key_id_api_keys_id_fk",
+ "tableFrom": "push_devices",
+ "tableTo": "api_keys",
+ "columnsFrom": [
+ "api_key_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "push_devices_id": {
+ "name": "push_devices_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "push_subscriptions": {
+ "name": "push_subscriptions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "p256dh": {
+ "name": "p256dh",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "auth": {
+ "name": "auth",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "push_subscriptions_endpoint_idx": {
+ "name": "push_subscriptions_endpoint_idx",
+ "columns": [
+ "endpoint"
+ ],
+ "isUnique": true
+ },
+ "push_subscriptions_user_idx": {
+ "name": "push_subscriptions_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "push_subscriptions_session_idx": {
+ "name": "push_subscriptions_session_idx",
+ "columns": [
+ "session_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "push_subscriptions_user_id_users_id_fk": {
+ "name": "push_subscriptions_user_id_users_id_fk",
+ "tableFrom": "push_subscriptions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "push_subscriptions_session_id_sessions_id_fk": {
+ "name": "push_subscriptions_session_id_sessions_id_fk",
+ "tableFrom": "push_subscriptions",
+ "tableTo": "sessions",
+ "columnsFrom": [
+ "session_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "push_subscriptions_id": {
+ "name": "push_subscriptions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "routing_rules": {
+ "name": "routing_rules",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'mailbox'"
+ },
+ "name": {
+ "name": "name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "pattern": {
+ "name": "pattern",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "match_field": {
+ "name": "match_field",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'email'"
+ },
+ "match_operator": {
+ "name": "match_operator",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'contains'"
+ },
+ "match_value": {
+ "name": "match_value",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "('')"
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'store'"
+ },
+ "forward_to": {
+ "name": "forward_to",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "keep_copy": {
+ "name": "keep_copy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "reject_reason": {
+ "name": "reject_reason",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "priority": {
+ "name": "priority",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "last_matched_at": {
+ "name": "last_matched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "match_count": {
+ "name": "match_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "routing_rules_domain_scope_idx": {
+ "name": "routing_rules_domain_scope_idx",
+ "columns": [
+ "domain_id",
+ "scope",
+ "enabled"
+ ],
+ "isUnique": false
+ },
+ "routing_rules_mailbox_idx": {
+ "name": "routing_rules_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "routing_rules_priority_idx": {
+ "name": "routing_rules_priority_idx",
+ "columns": [
+ "priority"
+ ],
+ "isUnique": false
+ },
+ "routing_rules_user_idx": {
+ "name": "routing_rules_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ },
+ "routing_rules_folder_idx": {
+ "name": "routing_rules_folder_idx",
+ "columns": [
+ "folder_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "routing_rules_user_id_users_id_fk": {
+ "name": "routing_rules_user_id_users_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "routing_rules_domain_id_domains_id_fk": {
+ "name": "routing_rules_domain_id_domains_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "routing_rules_mailbox_id_mailboxes_id_fk": {
+ "name": "routing_rules_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "routing_rules_folder_id_folders_id_fk": {
+ "name": "routing_rules_folder_id_folders_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "folders",
+ "columnsFrom": [
+ "folder_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "routing_rules_id": {
+ "name": "routing_rules_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "sessions": {
+ "name": "sessions",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "sessions_user_idx": {
+ "name": "sessions_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "sessions_id": {
+ "name": "sessions_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "sessions_token_hash_unique": {
+ "name": "sessions_token_hash_unique",
+ "columns": [
+ "token_hash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "shared_attachment_links": {
+ "name": "shared_attachment_links",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "shared_attachment_links_attachment_id_message_attachments_id_fk": {
+ "name": "shared_attachment_links_attachment_id_message_attachments_id_fk",
+ "tableFrom": "shared_attachment_links",
+ "tableTo": "message_attachments",
+ "columnsFrom": [
+ "attachment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "shared_attachment_links_id": {
+ "name": "shared_attachment_links_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "shared_attachment_links_attachment_id_unique": {
+ "name": "shared_attachment_links_attachment_id_unique",
+ "columns": [
+ "attachment_id"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "spam_feedback": {
+ "name": "spam_feedback",
+ "columns": {
+ "message_id": {
+ "name": "message_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "actor_user_id": {
+ "name": "actor_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "training_tokens": {
+ "name": "training_tokens",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reputation_keys": {
+ "name": "reputation_keys",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tokenizer_version": {
+ "name": "tokenizer_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "spam_feedback_mailbox_idx": {
+ "name": "spam_feedback_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ },
+ "spam_feedback_actor_user_idx": {
+ "name": "spam_feedback_actor_user_idx",
+ "columns": [
+ "actor_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "spam_feedback_message_id_messages_id_fk": {
+ "name": "spam_feedback_message_id_messages_id_fk",
+ "tableFrom": "spam_feedback",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "spam_feedback_mailbox_id_mailboxes_id_fk": {
+ "name": "spam_feedback_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "spam_feedback",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "spam_feedback_actor_user_id_users_id_fk": {
+ "name": "spam_feedback_actor_user_id_users_id_fk",
+ "tableFrom": "spam_feedback",
+ "tableTo": "users",
+ "columnsFrom": [
+ "actor_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "spam_feedback_message_id": {
+ "name": "spam_feedback_message_id",
+ "columns": [
+ "message_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "spam_reputation": {
+ "name": "spam_reputation",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "messages_seen": {
+ "name": "messages_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "spam_count": {
+ "name": "spam_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "ham_count": {
+ "name": "ham_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "spam_reputation_mailbox_type_key_idx": {
+ "name": "spam_reputation_mailbox_type_key_idx",
+ "columns": [
+ "mailbox_id",
+ "type",
+ "key"
+ ],
+ "isUnique": true
+ },
+ "spam_reputation_mailbox_idx": {
+ "name": "spam_reputation_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "spam_reputation_mailbox_id_mailboxes_id_fk": {
+ "name": "spam_reputation_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "spam_reputation",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "spam_token_stats": {
+ "name": "spam_token_stats",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "spam_count": {
+ "name": "spam_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "ham_count": {
+ "name": "ham_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "spam_token_stats_mailbox_token_idx": {
+ "name": "spam_token_stats_mailbox_token_idx",
+ "columns": [
+ "mailbox_id",
+ "token"
+ ],
+ "isUnique": true
+ },
+ "spam_token_stats_mailbox_idx": {
+ "name": "spam_token_stats_mailbox_idx",
+ "columns": [
+ "mailbox_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "spam_token_stats_mailbox_id_mailboxes_id_fk": {
+ "name": "spam_token_stats_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "spam_token_stats",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "user_compose_preferences": {
+ "name": "user_compose_preferences",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "track_opens_default": {
+ "name": "track_opens_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "undo_send_seconds": {
+ "name": "undo_send_seconds",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 15
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_compose_preferences_user_id_users_id_fk": {
+ "name": "user_compose_preferences_user_id_users_id_fk",
+ "tableFrom": "user_compose_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_compose_preferences_user_id": {
+ "name": "user_compose_preferences_user_id",
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reset_email": {
+ "name": "reset_email",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "forwarding_email": {
+ "name": "forwarding_email",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "booking_username": {
+ "name": "booking_username",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "avatar_key": {
+ "name": "avatar_key",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'user'"
+ },
+ "is_primary_admin": {
+ "name": "is_primary_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "disabled": {
+ "name": "disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "can_manage_mailboxes": {
+ "name": "can_manage_mailboxes",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "can_manage_domains": {
+ "name": "can_manage_domains",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "can_manage_users": {
+ "name": "can_manage_users",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "keyboard_shortcuts_enabled": {
+ "name": "keyboard_shortcuts_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "spam_protection_enabled": {
+ "name": "spam_protection_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "trash_retention_days": {
+ "name": "trash_retention_days",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "show_full_recipient_addresses": {
+ "name": "show_full_recipient_addresses",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "remote_content_mode": {
+ "name": "remote_content_mode",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'allow'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "totp_confirmed_at": {
+ "name": "totp_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_sign_in_at": {
+ "name": "last_sign_in_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "users_booking_username_idx": {
+ "name": "users_booking_username_idx",
+ "columns": [
+ "booking_username"
+ ],
+ "isUnique": true
+ },
+ "users_created_by_idx": {
+ "name": "users_created_by_idx",
+ "columns": [
+ "created_by_user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "users_created_by_user_id_users_id_fk": {
+ "name": "users_created_by_user_id_users_id_fk",
+ "tableFrom": "users",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "columns": [
+ "email"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "webhook_deliveries": {
+ "name": "webhook_deliveries",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "webhook_id": {
+ "name": "webhook_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "payload": {
+ "name": "payload",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "error": {
+ "name": "error",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "last_attempt_at": {
+ "name": "last_attempt_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "next_retry_at": {
+ "name": "next_retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "webhook_deliveries_webhook_idx": {
+ "name": "webhook_deliveries_webhook_idx",
+ "columns": [
+ "webhook_id",
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "webhook_deliveries_status_idx": {
+ "name": "webhook_deliveries_status_idx",
+ "columns": [
+ "status"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "webhook_deliveries_webhook_id_webhooks_id_fk": {
+ "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
+ "tableFrom": "webhook_deliveries",
+ "tableTo": "webhooks",
+ "columnsFrom": [
+ "webhook_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webhook_deliveries_id": {
+ "name": "webhook_deliveries_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "webhooks": {
+ "name": "webhooks",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(191)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "url": {
+ "name": "url",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "secret": {
+ "name": "secret",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "events": {
+ "name": "events",
+ "type": "longtext",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": true
+ },
+ "max_attempts": {
+ "name": "max_attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 5
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "webhooks_user_idx": {
+ "name": "webhooks_user_idx",
+ "columns": [
+ "user_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "webhooks_user_id_users_id_fk": {
+ "name": "webhooks_user_id_users_id_fk",
+ "tableFrom": "webhooks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "webhooks_id": {
+ "name": "webhooks_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/migrations-mysql/meta/_journal.json b/drizzle/migrations-mysql/meta/_journal.json
index 5e3295d..91b954d 100644
--- a/drizzle/migrations-mysql/meta/_journal.json
+++ b/drizzle/migrations-mysql/meta/_journal.json
@@ -15,6 +15,13 @@
"when": 1792869793885,
"tag": "0001_triggers_and_seeds",
"breakpoints": true
+ },
+ {
+ "idx": 2,
+ "version": "5",
+ "when": 1793174353930,
+ "tag": "0002_calendar_reminders",
+ "breakpoints": true
}
]
-}
+}
\ No newline at end of file
diff --git a/drizzle/migrations-pg/0002_calendar_reminders.sql b/drizzle/migrations-pg/0002_calendar_reminders.sql
new file mode 100644
index 0000000..310d772
--- /dev/null
+++ b/drizzle/migrations-pg/0002_calendar_reminders.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "calendar_events" ADD COLUMN "reminder_minutes" bigint;--> statement-breakpoint
+ALTER TABLE "calendar_events" ADD COLUMN "last_reminded_start" bigint;
\ No newline at end of file
diff --git a/drizzle/migrations-pg/meta/0002_snapshot.json b/drizzle/migrations-pg/meta/0002_snapshot.json
new file mode 100644
index 0000000..01518e2
--- /dev/null
+++ b/drizzle/migrations-pg/meta/0002_snapshot.json
@@ -0,0 +1,6967 @@
+{
+ "id": "aebfcbb6-b164-4804-a479-adb33ca6accd",
+ "prevId": "b48bf275-c424-4590-8daa-631fe092e5d6",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.agent_chat_messages": {
+ "name": "agent_chat_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tool_name": {
+ "name": "tool_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "agent_chat_messages_conversation_idx": {
+ "name": "agent_chat_messages_conversation_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "agent_chat_messages_conversation_id_agent_conversations_id_fk": {
+ "name": "agent_chat_messages_conversation_id_agent_conversations_id_fk",
+ "tableFrom": "agent_chat_messages",
+ "tableTo": "agent_conversations",
+ "columnsFrom": [
+ "conversation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.agent_conversations": {
+ "name": "agent_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'New conversation'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "agent_conversations_owner_idx": {
+ "name": "agent_conversations_owner_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_conversations_mailbox_idx": {
+ "name": "agent_conversations_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "agent_conversations_user_id_users_id_fk": {
+ "name": "agent_conversations_user_id_users_id_fk",
+ "tableFrom": "agent_conversations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_conversations_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_conversations_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_conversations",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.agent_draft_metadata": {
+ "name": "agent_draft_metadata",
+ "schema": "",
+ "columns": {
+ "draft_id": {
+ "name": "draft_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "origin": {
+ "name": "origin",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "human_edited_at": {
+ "name": "human_edited_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scheduled_at": {
+ "name": "scheduled_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "agent_draft_meta_source_msg_idx": {
+ "name": "agent_draft_meta_source_msg_idx",
+ "columns": [
+ {
+ "expression": "source_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_draft_metadata_mailbox_idx": {
+ "name": "agent_draft_metadata_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "agent_draft_metadata_draft_id_messages_id_fk": {
+ "name": "agent_draft_metadata_draft_id_messages_id_fk",
+ "tableFrom": "agent_draft_metadata",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "draft_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_draft_metadata_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_draft_metadata_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_draft_metadata",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_draft_metadata_source_message_id_messages_id_fk": {
+ "name": "agent_draft_metadata_source_message_id_messages_id_fk",
+ "tableFrom": "agent_draft_metadata",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "source_message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.agent_jobs": {
+ "name": "agent_jobs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "next_attempt_at": {
+ "name": "next_attempt_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reason": {
+ "name": "reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "agent_jobs_source_idx": {
+ "name": "agent_jobs_source_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "source_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_jobs_due_idx": {
+ "name": "agent_jobs_due_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "next_attempt_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_jobs_source_message_idx": {
+ "name": "agent_jobs_source_message_idx",
+ "columns": [
+ {
+ "expression": "source_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_jobs_draft_idx": {
+ "name": "agent_jobs_draft_idx",
+ "columns": [
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_jobs_reviewer_idx": {
+ "name": "agent_jobs_reviewer_idx",
+ "columns": [
+ {
+ "expression": "reviewer_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "agent_jobs_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_jobs_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_jobs_source_message_id_messages_id_fk": {
+ "name": "agent_jobs_source_message_id_messages_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "source_message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_jobs_reviewer_user_id_users_id_fk": {
+ "name": "agent_jobs_reviewer_user_id_users_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "reviewer_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_jobs_draft_id_messages_id_fk": {
+ "name": "agent_jobs_draft_id_messages_id_fk",
+ "tableFrom": "agent_jobs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "draft_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.agent_send_approvals": {
+ "name": "agent_send_approvals",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_key_id": {
+ "name": "request_key_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload_hash": {
+ "name": "payload_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "claimed_at": {
+ "name": "claimed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "agent_send_approvals_user_idx": {
+ "name": "agent_send_approvals_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_send_approvals_delivery_idx": {
+ "name": "agent_send_approvals_delivery_idx",
+ "columns": [
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "status IN ('claimed', 'sent', 'unknown')",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_send_approvals_request_key_idx": {
+ "name": "agent_send_approvals_request_key_idx",
+ "columns": [
+ {
+ "expression": "request_key_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_send_approvals_mailbox_idx": {
+ "name": "agent_send_approvals_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "agent_send_approvals_draft_idx": {
+ "name": "agent_send_approvals_draft_idx",
+ "columns": [
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "agent_send_approvals_draft_id_messages_id_fk": {
+ "name": "agent_send_approvals_draft_id_messages_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "draft_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_send_approvals_mailbox_id_mailboxes_id_fk": {
+ "name": "agent_send_approvals_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_send_approvals_user_id_users_id_fk": {
+ "name": "agent_send_approvals_user_id_users_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "agent_send_approvals_request_key_id_api_keys_id_fk": {
+ "name": "agent_send_approvals_request_key_id_api_keys_id_fk",
+ "tableFrom": "agent_send_approvals",
+ "tableTo": "api_keys",
+ "columnsFrom": [
+ "request_key_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ai_usage": {
+ "name": "ai_usage",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "input_tokens": {
+ "name": "input_tokens",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output_tokens": {
+ "name": "output_tokens",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cost_usd_micros": {
+ "name": "cost_usd_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "ai_usage_created_idx": {
+ "name": "ai_usage_created_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.api_keys": {
+ "name": "api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'legacy'"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scopes": {
+ "name": "scopes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_scope_enabled": {
+ "name": "mailbox_scope_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "api_keys_user_idx": {
+ "name": "api_keys_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "api_keys_user_id_users_id_fk": {
+ "name": "api_keys_user_id_users_id_fk",
+ "tableFrom": "api_keys",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.app_settings": {
+ "name": "app_settings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "app_name": {
+ "name": "app_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Mailflare'"
+ },
+ "outbound_attachment_max_mb": {
+ "name": "outbound_attachment_max_mb",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 25
+ },
+ "drive_storage_limit_bytes": {
+ "name": "drive_storage_limit_bytes",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resend_api_key": {
+ "name": "resend_api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "aws_config": {
+ "name": "aws_config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ses_receiving": {
+ "name": "ses_receiving",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resend_webhook_id": {
+ "name": "resend_webhook_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resend_webhook_secret": {
+ "name": "resend_webhook_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon_key": {
+ "name": "icon_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_enabled": {
+ "name": "agent_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "agent_provider": {
+ "name": "agent_provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_preset": {
+ "name": "agent_preset",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_base_url": {
+ "name": "agent_base_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_api_key": {
+ "name": "agent_api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_model": {
+ "name": "agent_model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_model_rates": {
+ "name": "agent_model_rates",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spamhaus_dqs_key": {
+ "name": "spamhaus_dqs_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "abusech_auth_key": {
+ "name": "abusech_auth_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spam_domain_age_check": {
+ "name": "spam_domain_age_check",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "spam_brands": {
+ "name": "spam_brands",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "actor_user_id": {
+ "name": "actor_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "target_user_id": {
+ "name": "target_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_idx": {
+ "name": "audit_logs_actor_idx",
+ "columns": [
+ {
+ "expression": "actor_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_mailbox_idx": {
+ "name": "audit_logs_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_idx": {
+ "name": "audit_logs_created_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_message_id_idx": {
+ "name": "audit_logs_message_id_idx",
+ "columns": [
+ {
+ "expression": "message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_user_idx": {
+ "name": "audit_logs_target_user_idx",
+ "columns": [
+ {
+ "expression": "target_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_user_id_users_id_fk": {
+ "name": "audit_logs_actor_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "actor_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "audit_logs_target_user_id_users_id_fk": {
+ "name": "audit_logs_target_user_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "target_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "audit_logs_mailbox_id_mailboxes_id_fk": {
+ "name": "audit_logs_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "audit_logs_message_id_messages_id_fk": {
+ "name": "audit_logs_message_id_messages_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auto_reply_deliveries": {
+ "name": "auto_reply_deliveries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "recipient": {
+ "name": "recipient",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sent_at": {
+ "name": "sent_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "auto_reply_deliveries_mailbox_recipient_idx": {
+ "name": "auto_reply_deliveries_mailbox_recipient_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "recipient",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "auto_reply_deliveries_sent_idx": {
+ "name": "auto_reply_deliveries_sent_idx",
+ "columns": [
+ {
+ "expression": "sent_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "auto_reply_deliveries_mailbox_id_mailboxes_id_fk": {
+ "name": "auto_reply_deliveries_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "auto_reply_deliveries",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.backup_settings": {
+ "name": "backup_settings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "schedule_type": {
+ "name": "schedule_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "schedule_value": {
+ "name": "schedule_value",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retention_enabled": {
+ "name": "retention_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "retention_days": {
+ "name": "retention_days",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 30
+ },
+ "excluded_table_groups": {
+ "name": "excluded_table_groups",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.backups": {
+ "name": "backups",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queued'"
+ },
+ "trigger": {
+ "name": "trigger",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "r2_key": {
+ "name": "r2_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "filename": {
+ "name": "filename",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "size": {
+ "name": "size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "backups_created_idx": {
+ "name": "backups_created_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "backups_status_idx": {
+ "name": "backups_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "backups_created_by_idx": {
+ "name": "backups_created_by_idx",
+ "columns": [
+ {
+ "expression": "created_by_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "backups_created_by_user_id_users_id_fk": {
+ "name": "backups_created_by_user_id_users_id_fk",
+ "tableFrom": "backups",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.booking_events": {
+ "name": "booking_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'#2563eb'"
+ },
+ "host_ids": {
+ "name": "host_ids",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "duration_minutes": {
+ "name": "duration_minutes",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "location": {
+ "name": "location",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "weekdays": {
+ "name": "weekdays",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[1,2,3,4,5]'"
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'09:00'"
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'17:00'"
+ },
+ "time_ranges": {
+ "name": "time_ranges",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[{\"startTime\":\"09:00\",\"endTime\":\"17:00\"}]'"
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'UTC'"
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "booking_events_user_idx": {
+ "name": "booking_events_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "booking_events_user_slug_idx": {
+ "name": "booking_events_user_slug_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "slug",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "booking_events_user_id_users_id_fk": {
+ "name": "booking_events_user_id_users_id_fk",
+ "tableFrom": "booking_events",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.calendar_events": {
+ "name": "calendar_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "location": {
+ "name": "location",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "attendees": {
+ "name": "attendees",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'blue'"
+ },
+ "repeat": {
+ "name": "repeat",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'none'"
+ },
+ "repeat_days": {
+ "name": "repeat_days",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "repeat_anchor_day": {
+ "name": "repeat_anchor_day",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "repeat_until": {
+ "name": "repeat_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "excluded_occurrences": {
+ "name": "excluded_occurrences",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "starts_at": {
+ "name": "starts_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ends_at": {
+ "name": "ends_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reminder_minutes": {
+ "name": "reminder_minutes",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_reminded_start": {
+ "name": "last_reminded_start",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "calendar_events_user_starts_idx": {
+ "name": "calendar_events_user_starts_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "starts_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "calendar_events_mailbox_idx": {
+ "name": "calendar_events_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "calendar_events_user_id_users_id_fk": {
+ "name": "calendar_events_user_id_users_id_fk",
+ "tableFrom": "calendar_events",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "calendar_events_mailbox_id_mailboxes_id_fk": {
+ "name": "calendar_events_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "calendar_events",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.contacts": {
+ "name": "contacts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "avatar_key": {
+ "name": "avatar_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'inbound'"
+ },
+ "blocked": {
+ "name": "blocked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "remote_content_allowed": {
+ "name": "remote_content_allowed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "contacts_user_email_idx": {
+ "name": "contacts_user_email_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "contacts_user_idx": {
+ "name": "contacts_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "contacts_user_id_users_id_fk": {
+ "name": "contacts_user_id_users_id_fk",
+ "tableFrom": "contacts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.domain_tracking_hosts": {
+ "name": "domain_tracking_hosts",
+ "schema": "",
+ "columns": {
+ "domain_id": {
+ "name": "domain_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "domain_tracking_hosts_hostname_idx": {
+ "name": "domain_tracking_hosts_hostname_idx",
+ "columns": [
+ {
+ "expression": "hostname",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "domain_tracking_hosts_domain_id_domains_id_fk": {
+ "name": "domain_tracking_hosts_domain_id_domains_id_fk",
+ "tableFrom": "domain_tracking_hosts",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.domains": {
+ "name": "domains",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hostname": {
+ "name": "hostname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "zone_id": {
+ "name": "zone_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "routing_status": {
+ "name": "routing_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sending_subdomain_tag": {
+ "name": "sending_subdomain_tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sending_provider": {
+ "name": "sending_provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'none'"
+ },
+ "receiving_provider": {
+ "name": "receiving_provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'cloudflare'"
+ },
+ "sending_requested": {
+ "name": "sending_requested",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sending_enabled": {
+ "name": "sending_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "routing_enabled": {
+ "name": "routing_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "dns_skipped": {
+ "name": "dns_skipped",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "domains_hostname_idx": {
+ "name": "domains_hostname_idx",
+ "columns": [
+ {
+ "expression": "hostname",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "domains_user_idx": {
+ "name": "domains_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "domains_user_id_users_id_fk": {
+ "name": "domains_user_id_users_id_fk",
+ "tableFrom": "domains",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.drive_items": {
+ "name": "drive_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "r2_key": {
+ "name": "r2_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "size": {
+ "name": "size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'application/octet-stream'"
+ },
+ "upload_id": {
+ "name": "upload_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "upload_part_size": {
+ "name": "upload_part_size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "upload_fingerprint": {
+ "name": "upload_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "link_token": {
+ "name": "link_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "trashed_at": {
+ "name": "trashed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "drive_items_owner_parent_idx": {
+ "name": "drive_items_owner_parent_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "parent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "drive_items_link_token_idx": {
+ "name": "drive_items_link_token_idx",
+ "columns": [
+ {
+ "expression": "link_token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "drive_items_owner_id_users_id_fk": {
+ "name": "drive_items_owner_id_users_id_fk",
+ "tableFrom": "drive_items",
+ "tableTo": "users",
+ "columnsFrom": [
+ "owner_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.drive_shares": {
+ "name": "drive_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "item_id": {
+ "name": "item_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'view'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "drive_shares_item_user_idx": {
+ "name": "drive_shares_item_user_idx",
+ "columns": [
+ {
+ "expression": "item_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "drive_shares_user_idx": {
+ "name": "drive_shares_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "drive_shares_item_id_drive_items_id_fk": {
+ "name": "drive_shares_item_id_drive_items_id_fk",
+ "tableFrom": "drive_shares",
+ "tableTo": "drive_items",
+ "columnsFrom": [
+ "item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "drive_shares_user_id_users_id_fk": {
+ "name": "drive_shares_user_id_users_id_fk",
+ "tableFrom": "drive_shares",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.drive_upload_parts": {
+ "name": "drive_upload_parts",
+ "schema": "",
+ "columns": {
+ "item_id": {
+ "name": "item_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "part_number": {
+ "name": "part_number",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "etag": {
+ "name": "etag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "drive_upload_parts_idx": {
+ "name": "drive_upload_parts_idx",
+ "columns": [
+ {
+ "expression": "item_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "part_number",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "drive_upload_parts_item_id_drive_items_id_fk": {
+ "name": "drive_upload_parts_item_id_drive_items_id_fk",
+ "tableFrom": "drive_upload_parts",
+ "tableTo": "drive_items",
+ "columnsFrom": [
+ "item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.email_templates": {
+ "name": "email_templates",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "text_body": {
+ "name": "text_body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "email_templates_user_idx": {
+ "name": "email_templates_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "email_templates_user_id_users_id_fk": {
+ "name": "email_templates_user_id_users_id_fk",
+ "tableFrom": "email_templates",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.folders": {
+ "name": "folders",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'#2563eb'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "folders_mailbox_name_idx": {
+ "name": "folders_mailbox_name_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "folders_user_idx": {
+ "name": "folders_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "folders_mailbox_idx": {
+ "name": "folders_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "folders_user_id_users_id_fk": {
+ "name": "folders_user_id_users_id_fk",
+ "tableFrom": "folders",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "folders_mailbox_id_mailboxes_id_fk": {
+ "name": "folders_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "folders",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.follow_ups": {
+ "name": "follow_ups",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "due_at": {
+ "name": "due_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "follow_ups_message_idx": {
+ "name": "follow_ups_message_idx",
+ "columns": [
+ {
+ "expression": "message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "follow_ups_status_due_idx": {
+ "name": "follow_ups_status_due_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "follow_ups_user_status_idx": {
+ "name": "follow_ups_user_status_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "follow_ups_message_id_messages_id_fk": {
+ "name": "follow_ups_message_id_messages_id_fk",
+ "tableFrom": "follow_ups",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "follow_ups_user_id_users_id_fk": {
+ "name": "follow_ups_user_id_users_id_fk",
+ "tableFrom": "follow_ups",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.import_jobs": {
+ "name": "import_jobs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queued'"
+ },
+ "total": {
+ "name": "total",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "processed": {
+ "name": "processed",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "imported": {
+ "name": "imported",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "skipped": {
+ "name": "skipped",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "spec": {
+ "name": "spec",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cursor": {
+ "name": "cursor",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "errors": {
+ "name": "errors",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "error_count": {
+ "name": "error_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "import_jobs_user_idx": {
+ "name": "import_jobs_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "import_jobs_status_idx": {
+ "name": "import_jobs_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "import_jobs_user_id_users_id_fk": {
+ "name": "import_jobs_user_id_users_id_fk",
+ "tableFrom": "import_jobs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "import_jobs_mailbox_id_mailboxes_id_fk": {
+ "name": "import_jobs_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "import_jobs",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.jmap_change_floor": {
+ "name": "jmap_change_floor",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "bigint",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "seq": {
+ "name": "seq",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.jmap_changes": {
+ "name": "jmap_changes",
+ "schema": "",
+ "columns": {
+ "seq": {
+ "name": "seq",
+ "type": "bigserial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "object_type": {
+ "name": "object_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "object_id": {
+ "name": "object_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "change": {
+ "name": "change",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(extract(epoch from now())::bigint)"
+ }
+ },
+ "indexes": {
+ "jmap_changes_mailbox_seq_idx": {
+ "name": "jmap_changes_mailbox_seq_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "seq",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.jmap_mailbox_revisions": {
+ "name": "jmap_mailbox_revisions",
+ "schema": "",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.license_settings": {
+ "name": "license_settings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "instance_id": {
+ "name": "instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "instance_url": {
+ "name": "instance_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "license_key_hash": {
+ "name": "license_key_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "plan": {
+ "name": "plan",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'community'"
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'inactive'"
+ },
+ "features": {
+ "name": "features",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "seat_limit": {
+ "name": "seat_limit",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "activated_at": {
+ "name": "activated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "validated_at": {
+ "name": "validated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "license_settings_instance_id_unique": {
+ "name": "license_settings_instance_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "instance_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_challenges": {
+ "name": "login_challenges",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "login_challenges_user_idx": {
+ "name": "login_challenges_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_challenges_user_id_users_id_fk": {
+ "name": "login_challenges_user_id_users_id_fk",
+ "tableFrom": "login_challenges",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "login_challenges_token_hash_unique": {
+ "name": "login_challenges_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token_hash"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mailbox_access": {
+ "name": "mailbox_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission": {
+ "name": "permission",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read_only'"
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "mailbox_access_mailbox_user_idx": {
+ "name": "mailbox_access_mailbox_user_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mailbox_access_user_idx": {
+ "name": "mailbox_access_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mailbox_access_mailbox_idx": {
+ "name": "mailbox_access_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mailbox_access_created_by_idx": {
+ "name": "mailbox_access_created_by_idx",
+ "columns": [
+ {
+ "expression": "created_by_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mailbox_access_mailbox_id_mailboxes_id_fk": {
+ "name": "mailbox_access_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mailbox_access",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_access_user_id_users_id_fk": {
+ "name": "mailbox_access_user_id_users_id_fk",
+ "tableFrom": "mailbox_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_access_created_by_user_id_users_id_fk": {
+ "name": "mailbox_access_created_by_user_id_users_id_fk",
+ "tableFrom": "mailbox_access",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mailbox_agent_settings": {
+ "name": "mailbox_agent_settings",
+ "schema": "",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "model_id": {
+ "name": "model_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auto_draft_enabled": {
+ "name": "auto_draft_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "instructions": {
+ "name": "instructions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "daily_limit": {
+ "name": "daily_limit",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 25
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "mailbox_agent_settings_reviewer_idx": {
+ "name": "mailbox_agent_settings_reviewer_idx",
+ "columns": [
+ {
+ "expression": "reviewer_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mailbox_agent_settings_mailbox_id_mailboxes_id_fk": {
+ "name": "mailbox_agent_settings_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mailbox_agent_settings",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_agent_settings_reviewer_user_id_users_id_fk": {
+ "name": "mailbox_agent_settings_reviewer_user_id_users_id_fk",
+ "tableFrom": "mailbox_agent_settings",
+ "tableTo": "users",
+ "columnsFrom": [
+ "reviewer_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mailbox_aliases": {
+ "name": "mailbox_aliases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "local_part": {
+ "name": "local_part",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "mailbox_aliases_address_idx": {
+ "name": "mailbox_aliases_address_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "local_part",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mailbox_aliases_mailbox_idx": {
+ "name": "mailbox_aliases_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mailbox_aliases_mailbox_id_mailboxes_id_fk": {
+ "name": "mailbox_aliases_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mailbox_aliases",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailbox_aliases_domain_id_domains_id_fk": {
+ "name": "mailbox_aliases_domain_id_domains_id_fk",
+ "tableFrom": "mailbox_aliases",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mailboxes": {
+ "name": "mailboxes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "local_part": {
+ "name": "local_part",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signature": {
+ "name": "signature",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auto_reply_enabled": {
+ "name": "auto_reply_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "auto_reply_subject": {
+ "name": "auto_reply_subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Out of office'"
+ },
+ "auto_reply_body": {
+ "name": "auto_reply_body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "avatar_key": {
+ "name": "avatar_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'personal'"
+ },
+ "use_all_domains": {
+ "name": "use_all_domains",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "disabled": {
+ "name": "disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "mailboxes_address_idx": {
+ "name": "mailboxes_address_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "local_part",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mailboxes_user_idx": {
+ "name": "mailboxes_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mailboxes_user_id_users_id_fk": {
+ "name": "mailboxes_user_id_users_id_fk",
+ "tableFrom": "mailboxes",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mailboxes_domain_id_domains_id_fk": {
+ "name": "mailboxes_domain_id_domains_id_fk",
+ "tableFrom": "mailboxes",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_key_mailboxes": {
+ "name": "mcp_key_mailboxes",
+ "schema": "",
+ "columns": {
+ "key_id": {
+ "name": "key_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "mcp_key_mailbox_idx": {
+ "name": "mcp_key_mailbox_idx",
+ "columns": [
+ {
+ "expression": "key_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_key_mailboxes_mailbox_idx": {
+ "name": "mcp_key_mailboxes_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_key_mailboxes_key_id_api_keys_id_fk": {
+ "name": "mcp_key_mailboxes_key_id_api_keys_id_fk",
+ "tableFrom": "mcp_key_mailboxes",
+ "tableTo": "api_keys",
+ "columnsFrom": [
+ "key_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "mcp_key_mailboxes_mailbox_id_mailboxes_id_fk": {
+ "name": "mcp_key_mailboxes_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "mcp_key_mailboxes",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.message_attachments": {
+ "name": "message_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "filename": {
+ "name": "filename",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "disposition": {
+ "name": "disposition",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'attachment'"
+ },
+ "content_id": {
+ "name": "content_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "r2_key": {
+ "name": "r2_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trashed_at": {
+ "name": "trashed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "message_attachments_message_idx": {
+ "name": "message_attachments_message_idx",
+ "columns": [
+ {
+ "expression": "message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "message_attachments_message_id_messages_id_fk": {
+ "name": "message_attachments_message_id_messages_id_fk",
+ "tableFrom": "message_attachments",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "message_attachments_r2_key_unique": {
+ "name": "message_attachments_r2_key_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "r2_key"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.message_opens": {
+ "name": "message_opens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "opened_at": {
+ "name": "opened_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client": {
+ "name": "client",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "device": {
+ "name": "device",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "city": {
+ "name": "city",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "automated": {
+ "name": "automated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "message_opens_token_idx": {
+ "name": "message_opens_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "opened_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "message_opens_token_message_tracking_token_fk": {
+ "name": "message_opens_token_message_tracking_token_fk",
+ "tableFrom": "message_opens",
+ "tableTo": "message_tracking",
+ "columnsFrom": [
+ "token"
+ ],
+ "columnsTo": [
+ "token"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.message_tracking": {
+ "name": "message_tracking",
+ "schema": "",
+ "columns": {
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "open_count": {
+ "name": "open_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "first_opened_at": {
+ "name": "first_opened_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_opened_at": {
+ "name": "last_opened_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "message_tracking_message_idx": {
+ "name": "message_tracking_message_idx",
+ "columns": [
+ {
+ "expression": "message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "message_tracking_message_id_messages_id_fk": {
+ "name": "message_tracking_message_id_messages_id_fk",
+ "tableFrom": "message_tracking",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.messages": {
+ "name": "messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "direction": {
+ "name": "direction",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_message_id": {
+ "name": "provider_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "from_addr": {
+ "name": "from_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "to_addr": {
+ "name": "to_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "cc_addr": {
+ "name": "cc_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "bcc_addr": {
+ "name": "bcc_addr",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reply_to": {
+ "name": "reply_to",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "snippet": {
+ "name": "snippet",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text_body": {
+ "name": "text_body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "html_body": {
+ "name": "html_body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "raw_r2_key": {
+ "name": "raw_r2_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'received'"
+ },
+ "read": {
+ "name": "read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "starred": {
+ "name": "starred",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "snoozed_until": {
+ "name": "snoozed_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "in_reply_to": {
+ "name": "in_reply_to",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "references_header": {
+ "name": "references_header",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spam_score": {
+ "name": "spam_score",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spam_verdict": {
+ "name": "spam_verdict",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spam_signals": {
+ "name": "spam_signals",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spam_analyzed_at": {
+ "name": "spam_analyzed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spam_analysis_error": {
+ "name": "spam_analysis_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "trashed_at": {
+ "name": "trashed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "messages_user_created_idx": {
+ "name": "messages_user_created_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_mailbox_idx": {
+ "name": "messages_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_folder_idx": {
+ "name": "messages_folder_idx",
+ "columns": [
+ {
+ "expression": "folder_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_thread_idx": {
+ "name": "messages_thread_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_provider_message_idx": {
+ "name": "messages_provider_message_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_raw_r2_key_idx": {
+ "name": "messages_raw_r2_key_idx",
+ "columns": [
+ {
+ "expression": "raw_r2_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_trashed_at_idx": {
+ "name": "messages_trashed_at_idx",
+ "columns": [
+ {
+ "expression": "trashed_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_inbox_page_idx": {
+ "name": "messages_inbox_page_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "\"created_at\" desc",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "\"id\" desc",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_thread_key_idx": {
+ "name": "messages_thread_key_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "coalesce(\"thread_id\", \"id\")",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_mailbox_thread_key_idx": {
+ "name": "messages_mailbox_thread_key_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "coalesce(\"thread_id\", \"id\")",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_nav_cover_idx": {
+ "name": "messages_nav_cover_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "\"created_at\" desc",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "\"id\" desc",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "direction",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "read",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "snoozed_until",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_counts_cover_idx": {
+ "name": "messages_counts_cover_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "folder_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "direction",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "read",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "starred",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "snoozed_until",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "messages_conv_cover_idx": {
+ "name": "messages_conv_cover_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "coalesce(\"thread_id\", \"id\")",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "snoozed_until",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "messages_user_id_users_id_fk": {
+ "name": "messages_user_id_users_id_fk",
+ "tableFrom": "messages",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "messages_mailbox_id_mailboxes_id_fk": {
+ "name": "messages_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "messages",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "messages_folder_id_folders_id_fk": {
+ "name": "messages_folder_id_folders_id_fk",
+ "tableFrom": "messages",
+ "tableTo": "folders",
+ "columnsFrom": [
+ "folder_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mfa_recovery_codes": {
+ "name": "mfa_recovery_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "mfa_recovery_codes_user_idx": {
+ "name": "mfa_recovery_codes_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mfa_recovery_codes_user_id_users_id_fk": {
+ "name": "mfa_recovery_codes_user_id_users_id_fk",
+ "tableFrom": "mfa_recovery_codes",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mfa_recovery_codes_code_hash_unique": {
+ "name": "mfa_recovery_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "code_hash"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.outbound_jobs": {
+ "name": "outbound_jobs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queued'"
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scheduled_at": {
+ "name": "scheduled_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "outbound_jobs_user_idx": {
+ "name": "outbound_jobs_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "outbound_jobs_message_idx": {
+ "name": "outbound_jobs_message_idx",
+ "columns": [
+ {
+ "expression": "message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "outbound_jobs_user_id_users_id_fk": {
+ "name": "outbound_jobs_user_id_users_id_fk",
+ "tableFrom": "outbound_jobs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "outbound_jobs_message_id_messages_id_fk": {
+ "name": "outbound_jobs_message_id_messages_id_fk",
+ "tableFrom": "outbound_jobs",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.password_reset_tokens": {
+ "name": "password_reset_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "password_reset_tokens_user_idx": {
+ "name": "password_reset_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "password_reset_tokens_user_id_users_id_fk": {
+ "name": "password_reset_tokens_user_id_users_id_fk",
+ "tableFrom": "password_reset_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "password_reset_tokens_token_hash_unique": {
+ "name": "password_reset_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token_hash"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.push_devices": {
+ "name": "push_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "api_key_id": {
+ "name": "api_key_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "environment": {
+ "name": "environment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'production'"
+ },
+ "topic": {
+ "name": "topic",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_key": {
+ "name": "public_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "previews": {
+ "name": "previews",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "client_ref": {
+ "name": "client_ref",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "push_devices_platform_token_user_idx": {
+ "name": "push_devices_platform_token_user_idx",
+ "columns": [
+ {
+ "expression": "platform",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "push_devices_user_idx": {
+ "name": "push_devices_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "push_devices_api_key_idx": {
+ "name": "push_devices_api_key_idx",
+ "columns": [
+ {
+ "expression": "api_key_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "push_devices_user_id_users_id_fk": {
+ "name": "push_devices_user_id_users_id_fk",
+ "tableFrom": "push_devices",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "push_devices_api_key_id_api_keys_id_fk": {
+ "name": "push_devices_api_key_id_api_keys_id_fk",
+ "tableFrom": "push_devices",
+ "tableTo": "api_keys",
+ "columnsFrom": [
+ "api_key_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.push_subscriptions": {
+ "name": "push_subscriptions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "p256dh": {
+ "name": "p256dh",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth": {
+ "name": "auth",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "push_subscriptions_endpoint_idx": {
+ "name": "push_subscriptions_endpoint_idx",
+ "columns": [
+ {
+ "expression": "endpoint",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "push_subscriptions_user_idx": {
+ "name": "push_subscriptions_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "push_subscriptions_session_idx": {
+ "name": "push_subscriptions_session_idx",
+ "columns": [
+ {
+ "expression": "session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "push_subscriptions_user_id_users_id_fk": {
+ "name": "push_subscriptions_user_id_users_id_fk",
+ "tableFrom": "push_subscriptions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "push_subscriptions_session_id_sessions_id_fk": {
+ "name": "push_subscriptions_session_id_sessions_id_fk",
+ "tableFrom": "push_subscriptions",
+ "tableTo": "sessions",
+ "columnsFrom": [
+ "session_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.routing_rules": {
+ "name": "routing_rules",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'mailbox'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "pattern": {
+ "name": "pattern",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "match_field": {
+ "name": "match_field",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'email'"
+ },
+ "match_operator": {
+ "name": "match_operator",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'contains'"
+ },
+ "match_value": {
+ "name": "match_value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "folder_id": {
+ "name": "folder_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "action": {
+ "name": "action",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'store'"
+ },
+ "forward_to": {
+ "name": "forward_to",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "keep_copy": {
+ "name": "keep_copy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "reject_reason": {
+ "name": "reject_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "priority": {
+ "name": "priority",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_matched_at": {
+ "name": "last_matched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "match_count": {
+ "name": "match_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "routing_rules_domain_scope_idx": {
+ "name": "routing_rules_domain_scope_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "enabled",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "routing_rules_mailbox_idx": {
+ "name": "routing_rules_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "routing_rules_priority_idx": {
+ "name": "routing_rules_priority_idx",
+ "columns": [
+ {
+ "expression": "priority",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "routing_rules_user_idx": {
+ "name": "routing_rules_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "routing_rules_folder_idx": {
+ "name": "routing_rules_folder_idx",
+ "columns": [
+ {
+ "expression": "folder_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "routing_rules_user_id_users_id_fk": {
+ "name": "routing_rules_user_id_users_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "routing_rules_domain_id_domains_id_fk": {
+ "name": "routing_rules_domain_id_domains_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "domains",
+ "columnsFrom": [
+ "domain_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "routing_rules_mailbox_id_mailboxes_id_fk": {
+ "name": "routing_rules_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "routing_rules_folder_id_folders_id_fk": {
+ "name": "routing_rules_folder_id_folders_id_fk",
+ "tableFrom": "routing_rules",
+ "tableTo": "folders",
+ "columnsFrom": [
+ "folder_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "sessions_user_idx": {
+ "name": "sessions_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_hash_unique": {
+ "name": "sessions_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token_hash"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.shared_attachment_links": {
+ "name": "shared_attachment_links",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "shared_attachment_links_attachment_id_message_attachments_id_fk": {
+ "name": "shared_attachment_links_attachment_id_message_attachments_id_fk",
+ "tableFrom": "shared_attachment_links",
+ "tableTo": "message_attachments",
+ "columnsFrom": [
+ "attachment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "shared_attachment_links_attachment_id_unique": {
+ "name": "shared_attachment_links_attachment_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "attachment_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.spam_feedback": {
+ "name": "spam_feedback",
+ "schema": "",
+ "columns": {
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_user_id": {
+ "name": "actor_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "classification": {
+ "name": "classification",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "training_tokens": {
+ "name": "training_tokens",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reputation_keys": {
+ "name": "reputation_keys",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tokenizer_version": {
+ "name": "tokenizer_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "spam_feedback_mailbox_idx": {
+ "name": "spam_feedback_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "spam_feedback_actor_user_idx": {
+ "name": "spam_feedback_actor_user_idx",
+ "columns": [
+ {
+ "expression": "actor_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "spam_feedback_message_id_messages_id_fk": {
+ "name": "spam_feedback_message_id_messages_id_fk",
+ "tableFrom": "spam_feedback",
+ "tableTo": "messages",
+ "columnsFrom": [
+ "message_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "spam_feedback_mailbox_id_mailboxes_id_fk": {
+ "name": "spam_feedback_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "spam_feedback",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "spam_feedback_actor_user_id_users_id_fk": {
+ "name": "spam_feedback_actor_user_id_users_id_fk",
+ "tableFrom": "spam_feedback",
+ "tableTo": "users",
+ "columnsFrom": [
+ "actor_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.spam_reputation": {
+ "name": "spam_reputation",
+ "schema": "",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "messages_seen": {
+ "name": "messages_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "spam_count": {
+ "name": "spam_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "ham_count": {
+ "name": "ham_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "spam_reputation_mailbox_type_key_idx": {
+ "name": "spam_reputation_mailbox_type_key_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "spam_reputation_mailbox_idx": {
+ "name": "spam_reputation_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "spam_reputation_mailbox_id_mailboxes_id_fk": {
+ "name": "spam_reputation_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "spam_reputation",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.spam_token_stats": {
+ "name": "spam_token_stats",
+ "schema": "",
+ "columns": {
+ "mailbox_id": {
+ "name": "mailbox_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "spam_count": {
+ "name": "spam_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "ham_count": {
+ "name": "ham_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "spam_token_stats_mailbox_token_idx": {
+ "name": "spam_token_stats_mailbox_token_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "spam_token_stats_mailbox_idx": {
+ "name": "spam_token_stats_mailbox_idx",
+ "columns": [
+ {
+ "expression": "mailbox_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "spam_token_stats_mailbox_id_mailboxes_id_fk": {
+ "name": "spam_token_stats_mailbox_id_mailboxes_id_fk",
+ "tableFrom": "spam_token_stats",
+ "tableTo": "mailboxes",
+ "columnsFrom": [
+ "mailbox_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_compose_preferences": {
+ "name": "user_compose_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "track_opens_default": {
+ "name": "track_opens_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "undo_send_seconds": {
+ "name": "undo_send_seconds",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 15
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_compose_preferences_user_id_users_id_fk": {
+ "name": "user_compose_preferences_user_id_users_id_fk",
+ "tableFrom": "user_compose_preferences",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reset_email": {
+ "name": "reset_email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "forwarding_email": {
+ "name": "forwarding_email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "booking_username": {
+ "name": "booking_username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "avatar_key": {
+ "name": "avatar_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'user'"
+ },
+ "is_primary_admin": {
+ "name": "is_primary_admin",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "disabled": {
+ "name": "disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "can_manage_mailboxes": {
+ "name": "can_manage_mailboxes",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "can_manage_domains": {
+ "name": "can_manage_domains",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "can_manage_users": {
+ "name": "can_manage_users",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "keyboard_shortcuts_enabled": {
+ "name": "keyboard_shortcuts_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "spam_protection_enabled": {
+ "name": "spam_protection_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "trash_retention_days": {
+ "name": "trash_retention_days",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "show_full_recipient_addresses": {
+ "name": "show_full_recipient_addresses",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "remote_content_mode": {
+ "name": "remote_content_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'allow'"
+ },
+ "totp_secret": {
+ "name": "totp_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "totp_enabled": {
+ "name": "totp_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "totp_confirmed_at": {
+ "name": "totp_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_sign_in_at": {
+ "name": "last_sign_in_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "users_booking_username_idx": {
+ "name": "users_booking_username_idx",
+ "columns": [
+ {
+ "expression": "booking_username",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_by_idx": {
+ "name": "users_created_by_idx",
+ "columns": [
+ {
+ "expression": "created_by_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "users_created_by_user_id_users_id_fk": {
+ "name": "users_created_by_user_id_users_id_fk",
+ "tableFrom": "users",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "email"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webhook_deliveries": {
+ "name": "webhook_deliveries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "webhook_id": {
+ "name": "webhook_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration_ms": {
+ "name": "duration_ms",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_attempt_at": {
+ "name": "last_attempt_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_retry_at": {
+ "name": "next_retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "webhook_deliveries_webhook_idx": {
+ "name": "webhook_deliveries_webhook_idx",
+ "columns": [
+ {
+ "expression": "webhook_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "webhook_deliveries_status_idx": {
+ "name": "webhook_deliveries_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "webhook_deliveries_webhook_id_webhooks_id_fk": {
+ "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
+ "tableFrom": "webhook_deliveries",
+ "tableTo": "webhooks",
+ "columnsFrom": [
+ "webhook_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.webhooks": {
+ "name": "webhooks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "secret": {
+ "name": "secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "events": {
+ "name": "events",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "max_attempts": {
+ "name": "max_attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 5
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "webhooks_user_idx": {
+ "name": "webhooks_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "webhooks_user_id_users_id_fk": {
+ "name": "webhooks_user_id_users_id_fk",
+ "tableFrom": "webhooks",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/migrations-pg/meta/_journal.json b/drizzle/migrations-pg/meta/_journal.json
index 87ac2e4..b543de8 100644
--- a/drizzle/migrations-pg/meta/_journal.json
+++ b/drizzle/migrations-pg/meta/_journal.json
@@ -15,6 +15,13 @@
"when": 1792869763877,
"tag": "0001_triggers_and_seeds",
"breakpoints": true
+ },
+ {
+ "idx": 2,
+ "version": "7",
+ "when": 1793174352247,
+ "tag": "0002_calendar_reminders",
+ "breakpoints": true
}
]
-}
+}
\ No newline at end of file
diff --git a/drizzle/migrations/0078_add_calendar_reminders.sql b/drizzle/migrations/0078_add_calendar_reminders.sql
new file mode 100644
index 0000000..e6c63f5
--- /dev/null
+++ b/drizzle/migrations/0078_add_calendar_reminders.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `calendar_events` ADD `reminder_minutes` integer;
+--> statement-breakpoint
+ALTER TABLE `calendar_events` ADD `last_reminded_start` integer;
diff --git a/drizzle/migrations/meta/_journal.json b/drizzle/migrations/meta/_journal.json
index 4cecdf3..48c5d95 100644
--- a/drizzle/migrations/meta/_journal.json
+++ b/drizzle/migrations/meta/_journal.json
@@ -484,6 +484,13 @@
"when": 1792855200000,
"tag": "0077_add_import_jobs",
"breakpoints": true
+ },
+ {
+ "idx": 70,
+ "version": "6",
+ "when": 1792858800000,
+ "tag": "0078_add_calendar_reminders",
+ "breakpoints": true
}
]
}
diff --git a/public/locales/ar.json b/public/locales/ar.json
index 2fc9016..0191993 100644
--- a/public/locales/ar.json
+++ b/public/locales/ar.json
@@ -2214,5 +2214,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/bn.json b/public/locales/bn.json
index d0aecde..ebdfa7b 100644
--- a/public/locales/bn.json
+++ b/public/locales/bn.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/de.json b/public/locales/de.json
index f40f368..92ba2f2 100644
--- a/public/locales/de.json
+++ b/public/locales/de.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/es.json b/public/locales/es.json
index f278f25..db8d1b9 100644
--- a/public/locales/es.json
+++ b/public/locales/es.json
@@ -2169,5 +2169,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/fa.json b/public/locales/fa.json
index 8feae2c..a845cfe 100644
--- a/public/locales/fa.json
+++ b/public/locales/fa.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/fr.json b/public/locales/fr.json
index 146aed8..73901a4 100644
--- a/public/locales/fr.json
+++ b/public/locales/fr.json
@@ -2169,5 +2169,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/gu.json b/public/locales/gu.json
index 91d1a96..1ff9726 100644
--- a/public/locales/gu.json
+++ b/public/locales/gu.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ha.json b/public/locales/ha.json
index e0c158b..c6f3ac6 100644
--- a/public/locales/ha.json
+++ b/public/locales/ha.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/hi.json b/public/locales/hi.json
index a1af00f..61d2c14 100644
--- a/public/locales/hi.json
+++ b/public/locales/hi.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/id.json b/public/locales/id.json
index 4d56110..b8906cc 100644
--- a/public/locales/id.json
+++ b/public/locales/id.json
@@ -2139,5 +2139,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/it.json b/public/locales/it.json
index b4f9fb9..682da20 100644
--- a/public/locales/it.json
+++ b/public/locales/it.json
@@ -2169,5 +2169,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ja.json b/public/locales/ja.json
index 1eed98d..8e7862b 100644
--- a/public/locales/ja.json
+++ b/public/locales/ja.json
@@ -2139,5 +2139,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/kn.json b/public/locales/kn.json
index 8b1e1d5..b2f2095 100644
--- a/public/locales/kn.json
+++ b/public/locales/kn.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ko.json b/public/locales/ko.json
index e51c4b5..62bc29a 100644
--- a/public/locales/ko.json
+++ b/public/locales/ko.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ml.json b/public/locales/ml.json
index 8a44ef0..2ff880e 100644
--- a/public/locales/ml.json
+++ b/public/locales/ml.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/mr.json b/public/locales/mr.json
index 6fd900f..3663eae 100644
--- a/public/locales/mr.json
+++ b/public/locales/mr.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ms.json b/public/locales/ms.json
index e50a278..d09944a 100644
--- a/public/locales/ms.json
+++ b/public/locales/ms.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/nl.json b/public/locales/nl.json
index 66a286f..8ce2d2d 100644
--- a/public/locales/nl.json
+++ b/public/locales/nl.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/pa.json b/public/locales/pa.json
index 057c6c1..1131e0b 100644
--- a/public/locales/pa.json
+++ b/public/locales/pa.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/pl.json b/public/locales/pl.json
index 6a2e7ef..5cf0837 100644
--- a/public/locales/pl.json
+++ b/public/locales/pl.json
@@ -2184,5 +2184,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/pt-BR.json b/public/locales/pt-BR.json
index 3ba6836..7a71073 100644
--- a/public/locales/pt-BR.json
+++ b/public/locales/pt-BR.json
@@ -2169,5 +2169,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/pt-PT.json b/public/locales/pt-PT.json
index 5e27e2e..5094093 100644
--- a/public/locales/pt-PT.json
+++ b/public/locales/pt-PT.json
@@ -2169,5 +2169,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ru.json b/public/locales/ru.json
index b3a6a3f..a795527 100644
--- a/public/locales/ru.json
+++ b/public/locales/ru.json
@@ -2184,5 +2184,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/si.json b/public/locales/si.json
index 4e6cb02..890dfe9 100644
--- a/public/locales/si.json
+++ b/public/locales/si.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/sw.json b/public/locales/sw.json
index c00b3ce..b2f15f8 100644
--- a/public/locales/sw.json
+++ b/public/locales/sw.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ta.json b/public/locales/ta.json
index 26c4865..7a45057 100644
--- a/public/locales/ta.json
+++ b/public/locales/ta.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/te.json b/public/locales/te.json
index 9ce3c10..2d86f76 100644
--- a/public/locales/te.json
+++ b/public/locales/te.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/th.json b/public/locales/th.json
index 97a1fc0..4161471 100644
--- a/public/locales/th.json
+++ b/public/locales/th.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/tr.json b/public/locales/tr.json
index 6428f90..87552c6 100644
--- a/public/locales/tr.json
+++ b/public/locales/tr.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/uk.json b/public/locales/uk.json
index d5c4a4c..8e8dd01 100644
--- a/public/locales/uk.json
+++ b/public/locales/uk.json
@@ -2184,5 +2184,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/ur.json b/public/locales/ur.json
index c38ae87..367ebe0 100644
--- a/public/locales/ur.json
+++ b/public/locales/ur.json
@@ -2154,5 +2154,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/vi.json b/public/locales/vi.json
index 1270ee6..fcc8fd3 100644
--- a/public/locales/vi.json
+++ b/public/locales/vi.json
@@ -2139,5 +2139,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json
index f0f58ed..95196a3 100644
--- a/public/locales/zh-CN.json
+++ b/public/locales/zh-CN.json
@@ -2139,5 +2139,17 @@
"dnsSkipped.markDone": "I've set it up",
"compose.cancelSend": "Cancel",
"compose.sendCancelled": "Sending cancelled. Message moved to Drafts.",
- "compose.cancelTooLate": "Too late to cancel: the message is already being sent."
+ "compose.cancelTooLate": "Too late to cancel: the message is already being sent.",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before"
}
diff --git a/server/runtime/scheduler.ts b/server/runtime/scheduler.ts
index 4b02fa0..053b159 100644
--- a/server/runtime/scheduler.ts
+++ b/server/runtime/scheduler.ts
@@ -5,6 +5,7 @@ import { runDriveTrashRetention } from "@/lib/drive/retention";
import { runAccountRetention } from "@/lib/accounts/deletion";
import { runJmapChangeRetention } from "@/lib/jmap/changes";
import { runFollowUpReminders } from "@/lib/follow-ups/service";
+import { runCalendarReminders } from "@/lib/calendar/reminders";
import { sweepImportJobs } from "@/lib/import/jobs";
/** Fire the daily 02:00 UTC backup and the recurring maintenance jobs, matching the cron triggers in wrangler.jsonc. */
@@ -16,6 +17,7 @@ export function startScheduler(env: CloudflareEnv) {
sweepImportJobs(env).catch((error) => console.error("Import job sweep failed", error));
const now = new Date();
runFollowUpReminders(env, now).catch((error) => console.error("Follow-up reminders failed", error));
+ runCalendarReminders(env, now).catch((error) => console.error("Calendar reminders failed", error));
const day = now.toISOString().slice(0, 10);
if (now.getUTCHours() !== 2 || lastRunDay === day) return;
lastRunDay = day;
diff --git a/src/app/(calendar)/calendar/page.tsx b/src/app/(calendar)/calendar/page.tsx
index 9aa0ea1..b6294c0 100644
--- a/src/app/(calendar)/calendar/page.tsx
+++ b/src/app/(calendar)/calendar/page.tsx
@@ -5,7 +5,7 @@ import { useRouter, useSearchParams } from "next/navigation";
import type { DragEvent, PointerEvent as ReactPointerEvent } from "react";
import { createPortal } from "react-dom";
import toast, { Toaster } from "react-hot-toast";
-import { AlignLeft, CalendarPlus2, Check, ChevronDown, ChevronLeft, ChevronRight, Clock3, MapPin, MoreVertical, Palette, Plus, Repeat2, Trash2, UsersRound, X } from "lucide-react";
+import { AlignLeft, CalendarPlus2, Check, ChevronDown, ChevronLeft, ChevronRight, Clock3, MapPin, MoreVertical, Palette, Bell, Plus, Repeat2, Trash2, UsersRound, X } from "lucide-react";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { mobilePrimaryActionClass } from "@/components/page-header-utils";
import { Button } from "@/components/ui/button";
@@ -15,6 +15,7 @@ import { RouteLoadingBarPortal } from "@/components/route-loading-bar-portal";
import { authFetch } from "@/lib/auth/client";
import { formatUserDate, getUserTimeZone, parseUserDateTimeLocal } from "@/lib/time/utils";
import { normalizeCalendarColor } from "@/lib/calendar/colors";
+import { REMINDER_MINUTE_OPTIONS } from "@/lib/calendar/reminder-utils";
import { DEFAULT_REPEAT_DAYS, parseCalendarRepeatDays } from "@/lib/calendar/recurrence";
import { DEFAULT_FOLDER_COLOR, FOLDER_COLOR_OPTIONS } from "@/lib/folders/colors";
import type { TranslationKey } from "@/lib/i18n/types";
@@ -61,6 +62,7 @@ export default function CalendarPage() {
const [color, setColor] = useState<string>(DEFAULT_FOLDER_COLOR);
const [repeat, setRepeat] = useState<CalendarRepeat>("none");
const [repeatDays, setRepeatDays] = useState<number[]>(DEFAULT_REPEAT_DAYS);
+ const [reminderMinutes, setReminderMinutes] = useState<number | null>(null);
const [startsAt, setStartsAt] = useState("");
const [endsAt, setEndsAt] = useState("");
const [durationOptionsOpen, setDurationOptionsOpen] = useState(false);
@@ -157,6 +159,7 @@ export default function CalendarPage() {
setColor(DEFAULT_FOLDER_COLOR);
setRepeat("none");
setRepeatDays(DEFAULT_REPEAT_DAYS);
+ setReminderMinutes(null);
setGuests("");
setLocation("");
setDescription("");
@@ -190,7 +193,7 @@ export default function CalendarPage() {
method: editing ? "PATCH" : "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
- title, startsAt: savedStart.toISOString(), endsAt: savedEnd.toISOString(), color, repeat, repeatDays, repeatAnchorDay, effectiveFrom: effectiveFrom?.toISOString(), moveOccurrenceToPast: movingToPast, attendees: guests.split(","),
+ title, startsAt: savedStart.toISOString(), endsAt: savedEnd.toISOString(), color, repeat, repeatDays, repeatAnchorDay, reminderMinutes, effectiveFrom: effectiveFrom?.toISOString(), moveOccurrenceToPast: movingToPast, attendees: guests.split(","),
timeZone: getUserTimeZone(),
description,
location,
@@ -239,6 +242,7 @@ export default function CalendarPage() {
setTitle(event.title);
setColor(normalizeCalendarColor(event.color));
setRepeat(event.repeat);
+ setReminderMinutes(event.reminderMinutes ?? null);
setRepeatDays(event.repeat === "weekdays" ? parseCalendarRepeatDays(event.repeatDays) : DEFAULT_REPEAT_DAYS);
setLocation(event.location ?? "");
setDescription(event.description ?? "");
@@ -571,6 +575,19 @@ export default function CalendarPage() {
</div>}
</div>
</div>
+ <div className="grid grid-cols-[24px_minmax(0,1fr)] items-start gap-3">
+ <Bell aria-hidden="true" className="mt-2 h-5 w-5 text-neutral-600" />
+ <div className="relative min-w-0">
+ <select value={reminderMinutes ?? ""} onChange={(event) => setReminderMinutes(event.target.value === "" ? null : Number(event.target.value))} aria-label={t("calendar.reminder")}
+ className="h-9 w-full appearance-none rounded-md border border-transparent bg-transparent pl-2 pr-8 text-sm text-neutral-700 outline-none hover:bg-neutral-50 focus:border-blue-600 focus:bg-white">
+ <option value="">{t("calendar.reminder.none")}</option>
+ {REMINDER_MINUTE_OPTIONS.map((minutes) => (
+ <option key={minutes} value={minutes}>{t(`calendar.reminder.m${minutes}` as TranslationKey)}</option>
+ ))}
+ </select>
+ <ChevronDown aria-hidden="true" className="pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-500" />
+ </div>
+ </div>
<div className="grid grid-cols-[24px_minmax(0,1fr)] items-start gap-3">
<Repeat2 aria-hidden="true" className="mt-2 h-5 w-5 text-neutral-600" />
<div className="min-w-0">
diff --git a/src/app/(calendar)/calendar/types.d.ts b/src/app/(calendar)/calendar/types.d.ts
index 3c5191e..e0ebf39 100644
--- a/src/app/(calendar)/calendar/types.d.ts
+++ b/src/app/(calendar)/calendar/types.d.ts
@@ -14,6 +14,7 @@ export type CalendarEvent = {
repeatAnchorDay: number | null;
repeatUntil: string | null;
excludedOccurrences: string;
+ reminderMinutes?: number | null;
timeZone?: string | null;
seriesStartsAt?: string;
};
diff --git a/src/app/api/calendar/events/[eventId]/route.ts b/src/app/api/calendar/events/[eventId]/route.ts
index 93cd87a..d6d8908 100644
--- a/src/app/api/calendar/events/[eventId]/route.ts
+++ b/src/app/api/calendar/events/[eventId]/route.ts
@@ -8,6 +8,7 @@ import { sendEmail } from "@/lib/email/send";
import type { CalendarEventInput } from "../types";
import type { CalendarEventRouteParams } from "./types";
import { normalizeCalendarColor } from "@/lib/calendar/colors";
+import { normalizeReminderMinutes } from "@/lib/calendar/reminder-utils";
import { DEFAULT_REPEAT_DAYS, normalizeCalendarRepeat, normalizeCalendarRepeatDays, parseCalendarOccurrenceId, parseCalendarRepeatDays, parseExcludedOccurrences } from "@/lib/calendar/recurrence";
import { newId } from "@/lib/ids";
import { getRequestTimeZone, normalizeTimeZone } from "@/lib/time/utils";
@@ -48,14 +49,14 @@ export async function PATCH(request: Request, { params }: CalendarEventRoutePara
const repeatDays = repeat === "weekdays" ? normalizeCalendarRepeatDays(input.repeatDays ?? (existing.repeat === "weekdays" ? parseCalendarRepeatDays(existing.repeatDays) : DEFAULT_REPEAT_DAYS)) : [];
if (repeat === "weekdays" && repeatDays.length === 0) return NextResponse.json({ error: "Choose at least one weekday" }, { status: 400 });
const repeatAnchorDay = repeat === "monthly" && Number.isInteger(input.repeatAnchorDay) && input.repeatAnchorDay! >= 1 && input.repeatAnchorDay! <= 31 ? input.repeatAnchorDay : repeat === "monthly" ? existing.repeatAnchorDay : null;
- const event = { ...existing, timeZone, title: input.title.trim(), description: input.description?.trim() ?? "", location: input.location?.trim() ?? "", attendees: JSON.stringify(attendees), color: normalizeCalendarColor(input.color ?? existing.color), repeat, repeatDays: JSON.stringify(repeatDays), repeatAnchorDay, repeatUntil: repeat === "none" ? null : existing.repeatUntil, startsAt, endsAt };
+ const event = { ...existing, timeZone, title: input.title.trim(), description: input.description?.trim() ?? "", location: input.location?.trim() ?? "", attendees: JSON.stringify(attendees), color: normalizeCalendarColor(input.color ?? existing.color), repeat, repeatDays: JSON.stringify(repeatDays), repeatAnchorDay, repeatUntil: repeat === "none" ? null : existing.repeatUntil, reminderMinutes: input.reminderMinutes === undefined ? existing.reminderMinutes : normalizeReminderMinutes(input.reminderMinutes), lastRemindedStart: null, startsAt, endsAt };
const splitAt = existing.repeat !== "none" ? effectiveFrom : null;
if (splitAt && splitAt > existing.startsAt) {
const now = new Date();
await db.insert(calendarEvents).values({ ...event, id: newId("evt"), createdAt: now, updatedAt: now });
await db.update(calendarEvents).set({ repeatUntil: splitAt, updatedAt: now }).where(eq(calendarEvents.id, existing.id));
} else {
- await db.update(calendarEvents).set({ title: event.title, description: event.description, location: event.location, attendees: event.attendees, color: event.color, repeat: event.repeat, repeatDays: event.repeatDays, repeatAnchorDay: event.repeatAnchorDay, repeatUntil: event.repeatUntil, timeZone, startsAt, endsAt, updatedAt: new Date() }).where(eq(calendarEvents.id, existing.id));
+ await db.update(calendarEvents).set({ title: event.title, description: event.description, location: event.location, attendees: event.attendees, color: event.color, repeat: event.repeat, repeatDays: event.repeatDays, repeatAnchorDay: event.repeatAnchorDay, repeatUntil: event.repeatUntil, reminderMinutes: event.reminderMinutes, lastRemindedStart: null, timeZone, startsAt, endsAt, updatedAt: new Date() }).where(eq(calendarEvents.id, existing.id));
}
if (attendees.length && existing.mailboxId && input.from) { const file = createCalendarInvitation({ ...event, uid: existing.id }); await Promise.all(attendees.map((to) => sendEmail(env, { userId: user.id, mailboxId: existing.mailboxId!, from: input.from!, to, subject: `Updated invitation: ${event.title}`, text: event.description || `This event has been updated: ${event.title}.`, attachments: [{ filename: "invite.ics", type: "text/calendar; charset=utf-8", content: file }] }))); }
return NextResponse.json({ ok: true });
diff --git a/src/app/api/calendar/events/route.ts b/src/app/api/calendar/events/route.ts
index f435643..bb322aa 100644
--- a/src/app/api/calendar/events/route.ts
+++ b/src/app/api/calendar/events/route.ts
@@ -7,6 +7,7 @@ import { newId } from "@/lib/ids";
import { sendEmail } from "@/lib/email/send";
import { createCalendarInvitation } from "@/lib/calendar/utils";
import { normalizeCalendarColor } from "@/lib/calendar/colors";
+import { normalizeReminderMinutes } from "@/lib/calendar/reminder-utils";
import { DEFAULT_REPEAT_DAYS, normalizeCalendarRepeat, normalizeCalendarRepeatDays } from "@/lib/calendar/recurrence";
import type { CalendarEventInput } from "./types";
import { getRequestTimeZone, normalizeTimeZone } from "@/lib/time/utils";
@@ -36,7 +37,7 @@ export async function POST(request: Request) {
if (repeat === "weekdays" && repeatDays.length === 0) return NextResponse.json({ error: "Choose at least one weekday" }, { status: 400 });
const attendees = (input.attendees ?? []).map((email) => email.trim()).filter((email) => /^\S+@\S+\.\S+$/.test(email));
if (attendees.length && input.mailboxId && !calendarKeyCanSendInvitations(key, input.mailboxId)) return NextResponse.json({ error: "Sending invitations requires mail send permission for this mailbox" }, { status: 403 });
- const event = { id: newId("evt"), userId: user.id, mailboxId: input.mailboxId ?? null, title: input.title.trim(), description: input.description?.trim() ?? "", location: input.location?.trim() ?? "", attendees: JSON.stringify(attendees), color: normalizeCalendarColor(input.color), repeat, repeatDays: JSON.stringify(repeatDays), repeatAnchorDay: repeat === "monthly" && Number.isInteger(input.repeatAnchorDay) && input.repeatAnchorDay! >= 1 && input.repeatAnchorDay! <= 31 ? input.repeatAnchorDay : null, startsAt, endsAt };
+ const event = { id: newId("evt"), userId: user.id, mailboxId: input.mailboxId ?? null, title: input.title.trim(), description: input.description?.trim() ?? "", location: input.location?.trim() ?? "", attendees: JSON.stringify(attendees), color: normalizeCalendarColor(input.color), repeat, repeatDays: JSON.stringify(repeatDays), repeatAnchorDay: repeat === "monthly" && Number.isInteger(input.repeatAnchorDay) && input.repeatAnchorDay! >= 1 && input.repeatAnchorDay! <= 31 ? input.repeatAnchorDay : null, reminderMinutes: normalizeReminderMinutes(input.reminderMinutes), startsAt, endsAt };
const savedEvent = { ...event, timeZone: input.timeZone ? normalizeTimeZone(input.timeZone) : getRequestTimeZone(request, user.timeZone) };
await getDb(env).insert(calendarEvents).values(savedEvent);
if (attendees.length && input.mailboxId) {
diff --git a/src/app/api/calendar/events/types.d.ts b/src/app/api/calendar/events/types.d.ts
index 6c5fbf1..9a6e456 100644
--- a/src/app/api/calendar/events/types.d.ts
+++ b/src/app/api/calendar/events/types.d.ts
@@ -9,6 +9,7 @@ export type CalendarEventInput = {
repeat?: CalendarRepeat;
repeatDays?: number[];
repeatAnchorDay?: number;
+ reminderMinutes?: number | null;
timeZone?: string;
effectiveFrom?: string;
moveOccurrenceToPast?: boolean;
diff --git a/src/db/schema/index.ts b/src/db/schema/index.ts
index b689d6e..a8311f8 100644
--- a/src/db/schema/index.ts
+++ b/src/db/schema/index.ts
@@ -585,6 +585,10 @@ export const calendarEvents = sqliteTable(
timeZone: text("time_zone"),
startsAt: timestamp("starts_at").notNull(),
endsAt: timestamp("ends_at").notNull(),
+ /** Minutes before an occurrence's start to send a push reminder; null means no reminder. */
+ reminderMinutes: integer("reminder_minutes"),
+ /** Start of the latest occurrence a reminder was sent for; dedupes the five-minute cron. */
+ lastRemindedStart: timestamp("last_reminded_start"),
createdAt: timestamp("created_at").notNull().$defaultFn(() => new Date()),
updatedAt: timestamp("updated_at").notNull().$defaultFn(() => new Date()),
},
diff --git a/src/lib/calendar/reminder-utils.ts b/src/lib/calendar/reminder-utils.ts
new file mode 100644
index 0000000..4db5a57
--- /dev/null
+++ b/src/lib/calendar/reminder-utils.ts
@@ -0,0 +1,21 @@
+/** Offsets the event editor offers, in minutes before the start. */
+export const REMINDER_MINUTE_OPTIONS = [0, 5, 10, 15, 30, 60, 120, 1440, 2880, 10080] as const;
+
+export const MAX_REMINDER_MINUTES = 10080;
+
+/** Reminder offset from untrusted input: a whole number of minutes in range, otherwise no reminder. */
+export function normalizeReminderMinutes(value: unknown): number | null {
+ return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_REMINDER_MINUTES ? value : null;
+}
+
+/** Push body: when the occurrence starts in the event's zone, then the place if it has one. */
+export function formatReminderBody(startsAt: Date, timeZone: string, location: string): string {
+ let time: string;
+ try {
+ time = new Intl.DateTimeFormat("en-US", { weekday: "short", month: "short", day: "numeric", hour: "numeric", minute: "2-digit", timeZone }).format(startsAt);
+ } catch {
+ time = startsAt.toISOString();
+ }
+ const place = location.trim();
+ return place ? `${time} · ${place}` : time;
+}
diff --git a/src/lib/calendar/reminders.ts b/src/lib/calendar/reminders.ts
new file mode 100644
index 0000000..b25a61f
--- /dev/null
+++ b/src/lib/calendar/reminders.ts
@@ -0,0 +1,69 @@
+import { and, eq, gt, isNotNull, lte, or, ne, isNull, sql } from "drizzle-orm";
+import { getDb } from "@/db";
+import { calendarEvents } from "@/db/schema";
+import { isMissingColumnError } from "@/lib/database-errors";
+import { sendPushContent } from "@/lib/push/server";
+import { normalizeTimeZone } from "@/lib/time/utils";
+import { expandToolEvents } from "./tool-occurrences";
+import { MAX_REMINDER_MINUTES, formatReminderBody } from "./reminder-utils";
+
+/** Events checked per cron run; the next run picks up the rest. */
+const REMINDER_BATCH = 500;
+/** Occurrences reminded per event per run, so a long lead time on a daily event cannot flood a device. */
+const MAX_OCCURRENCES_PER_EVENT = 3;
+
+/**
+ * Five-minute cron: sends a push for each occurrence whose start minus the event's reminder offset has passed
+ * and which has not started yet. The occurrence start is claimed on the row before sending, so overlapping runs
+ * and retries never notify twice.
+ */
+export async function runCalendarReminders(env: CloudflareEnv, now: Date): Promise<void> {
+ try {
+ const db = getDb(env);
+ const horizon = new Date(now.getTime() + MAX_REMINDER_MINUTES * 60_000);
+ const rows = await db
+ .select()
+ .from(calendarEvents)
+ .where(and(
+ isNotNull(calendarEvents.reminderMinutes),
+ lte(calendarEvents.startsAt, horizon),
+ or(ne(calendarEvents.repeat, "none"), gt(calendarEvents.startsAt, now)),
+ or(isNull(calendarEvents.repeatUntil), gt(calendarEvents.repeatUntil, now)),
+ ))
+ .limit(REMINDER_BATCH);
+
+ for (const event of rows) {
+ const lead = (event.reminderMinutes ?? 0) * 60_000;
+ const last = event.lastRemindedStart?.getTime() ?? 0;
+ const due = expandToolEvents([event], now, new Date(now.getTime() + lead + 1))
+ .map((occurrence) => ({ ...occurrence, start: new Date(occurrence.startsAt) }))
+ .filter((occurrence) => occurrence.start > now && occurrence.start.getTime() - lead <= now.getTime() && occurrence.start.getTime() > last)
+ .slice(0, MAX_OCCURRENCES_PER_EVENT);
+ if (!due.length) continue;
+
+ const newest = due[due.length - 1].start;
+ const claimed = await db
+ .update(calendarEvents)
+ .set({ lastRemindedStart: newest })
+ .where(and(
+ eq(calendarEvents.id, event.id),
+ or(isNull(calendarEvents.lastRemindedStart), sql`${calendarEvents.lastRemindedStart} < ${newest}`),
+ ))
+ .returning({ id: calendarEvents.id });
+ if (!claimed.length) continue;
+
+ const zone = normalizeTimeZone(event.timeZone);
+ for (const occurrence of due) {
+ await sendPushContent(env, [event.userId], {
+ title: event.title.slice(0, 180),
+ body: formatReminderBody(occurrence.start, zone, event.location),
+ tag: `calendar:${event.id}:${occurrence.start.getTime()}`,
+ url: "/calendar",
+ });
+ }
+ }
+ } catch (error) {
+ // Before migration 0078 the reminder columns do not exist; there is nothing to remind about yet.
+ if (!isMissingColumnError(error)) throw error;
+ }
+}
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index 2fc1d59..ec9e8ae 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -1673,6 +1673,18 @@
"calendar.dur.30": "30 mins",
"calendar.dur.60": "1 hour",
"calendar.dur.1440": "1 day",
+ "calendar.reminder": "Reminder",
+ "calendar.reminder.none": "No reminder",
+ "calendar.reminder.m0": "At time of event",
+ "calendar.reminder.m5": "5 minutes before",
+ "calendar.reminder.m10": "10 minutes before",
+ "calendar.reminder.m15": "15 minutes before",
+ "calendar.reminder.m30": "30 minutes before",
+ "calendar.reminder.m60": "1 hour before",
+ "calendar.reminder.m120": "2 hours before",
+ "calendar.reminder.m1440": "1 day before",
+ "calendar.reminder.m2880": "2 days before",
+ "calendar.reminder.m10080": "1 week before",
"calendar.repeat": "Repeat",
"calendar.repeat.none": "Does not repeat",
"calendar.repeat.daily": "Daily",
diff --git a/src/lib/migrations/bundle-mysql.json b/src/lib/migrations/bundle-mysql.json
index 9d115eb..a052314 100644
--- a/src/lib/migrations/bundle-mysql.json
+++ b/src/lib/migrations/bundle-mysql.json
@@ -241,6 +241,13 @@
"CREATE TRIGGER mailbox_aliases_jmap_au AFTER UPDATE ON mailbox_aliases FOR EACH ROW\nBEGIN\n\tINSERT INTO jmap_mailbox_revisions (mailbox_id, revision) VALUES (NEW.mailbox_id, 1) ON DUPLICATE KEY UPDATE revision = revision + 1;\n\tIF NOT (OLD.mailbox_id <=> NEW.mailbox_id) THEN\n\t\tINSERT INTO jmap_mailbox_revisions (mailbox_id, revision) VALUES (OLD.mailbox_id, 1) ON DUPLICATE KEY UPDATE revision = revision + 1;\n\tEND IF;\nEND;",
"CREATE TRIGGER mailbox_aliases_jmap_ad AFTER DELETE ON mailbox_aliases FOR EACH ROW\nBEGIN\n\tINSERT INTO jmap_mailbox_revisions (mailbox_id, revision) VALUES (OLD.mailbox_id, 1) ON DUPLICATE KEY UPDATE revision = revision + 1;\nEND;"
]
+ },
+ {
+ "name": "0002_calendar_reminders.sql",
+ "statements": [
+ "ALTER TABLE `calendar_events` ADD `reminder_minutes` bigint;",
+ "ALTER TABLE `calendar_events` ADD `last_reminded_start` bigint;"
+ ]
}
]
}
diff --git a/src/lib/migrations/bundle-postgres.json b/src/lib/migrations/bundle-postgres.json
index f259805..bfb4579 100644
--- a/src/lib/migrations/bundle-postgres.json
+++ b/src/lib/migrations/bundle-postgres.json
@@ -262,6 +262,13 @@
"CREATE TRIGGER mailbox_aliases_jmap_changed AFTER INSERT OR UPDATE OR DELETE ON mailbox_aliases\nFOR EACH ROW EXECUTE FUNCTION mailflare_aliases_changed();",
"DO $$\nBEGIN\n\tCREATE EXTENSION IF NOT EXISTS pg_trgm;\n\tCREATE INDEX messages_subject_trgm_idx ON messages USING gin (lower(subject) gin_trgm_ops);\n\tCREATE INDEX messages_text_body_trgm_idx ON messages USING gin (lower(text_body) gin_trgm_ops);\nEXCEPTION WHEN OTHERS THEN\n\tRAISE NOTICE 'pg_trgm is unavailable; message search will scan with ILIKE instead (%).', SQLERRM;\nEND;\n$$;"
]
+ },
+ {
+ "name": "0002_calendar_reminders.sql",
+ "statements": [
+ "ALTER TABLE \"calendar_events\" ADD COLUMN \"reminder_minutes\" bigint;",
+ "ALTER TABLE \"calendar_events\" ADD COLUMN \"last_reminded_start\" bigint;"
+ ]
}
]
}
diff --git a/src/lib/push/server.ts b/src/lib/push/server.ts
index 0c74810..ef356a0 100644
--- a/src/lib/push/server.ts
+++ b/src/lib/push/server.ts
@@ -242,10 +242,32 @@ async function sendSubscriptionPush(
});
}
+export type PushContent = {
+ title: string;
+ body: string;
+ tag: string;
+ url: string;
+};
+
export async function sendPushNotifications(
env: CloudflareEnv,
userIds: string[],
payload: NewMessageNotification,
+): Promise<void> {
+ const sender = (payload.fromName ?? payload.from).slice(0, 240);
+ await sendPushContent(env, userIds, {
+ title: (payload.subject || "New email").slice(0, 180),
+ body: `From ${sender}`,
+ tag: payload.messageId,
+ url: `/inbox/${payload.messageId}`,
+ });
+}
+
+/** Delivers an arbitrary notification (title, body, tag, in-app url) to every live Web Push subscription of the users. */
+export async function sendPushContent(
+ env: CloudflareEnv,
+ userIds: string[],
+ content: PushContent,
): Promise<void> {
const config = parseVapidConfig(env);
const uniqueUserIds = [...new Set(userIds)];
@@ -268,15 +290,10 @@ export async function sendPushNotifications(
),
);
- const title = (payload.subject || "New email").slice(0, 180);
- const sender = (payload.fromName ?? payload.from).slice(0, 240);
const notificationPayload = JSON.stringify({
- title,
- body: `From ${sender}`,
+ ...content,
icon: "/icon-192.png",
badge: "/icon-96.png",
- tag: payload.messageId,
- url: `/inbox/${payload.messageId}`,
});
await Promise.allSettled(
diff --git a/tests/calendar-reminders.test.mjs b/tests/calendar-reminders.test.mjs
new file mode 100644
index 0000000..c5feb9c
--- /dev/null
+++ b/tests/calendar-reminders.test.mjs
@@ -0,0 +1,35 @@
+import assert from "node:assert/strict";
+import { mkdtempSync, rmSync } from "node:fs";
+import { dirname, join } from "node:path";
+import test, { after } from "node:test";
+import { fileURLToPath, pathToFileURL } from "node:url";
+import { build } from "esbuild";
+
+const root = join(dirname(fileURLToPath(import.meta.url)), "..");
+const outDir = mkdtempSync(join(root, "tests", ".tmp-calendar-reminders-"));
+after(() => rmSync(outDir, { recursive: true, force: true }));
+
+await build({
+ entryPoints: { utils: join(root, "src/lib/calendar/reminder-utils.ts") },
+ outdir: outDir,
+ outExtension: { ".js": ".mjs" },
+ bundle: true,
+ platform: "node",
+ format: "esm",
+ target: "node22",
+ alias: { "@": join(root, "src") },
+ logLevel: "silent",
+});
+const { normalizeReminderMinutes, formatReminderBody, REMINDER_MINUTE_OPTIONS } = await import(pathToFileURL(join(outDir, "utils.mjs")).href);
+
+test("reminder offsets accept whole minutes in range and nothing else", () => {
+ for (const minutes of REMINDER_MINUTE_OPTIONS) assert.equal(normalizeReminderMinutes(minutes), minutes);
+ for (const bad of [-1, 1.5, 10081, "15", null, undefined, NaN]) assert.equal(normalizeReminderMinutes(bad), null, String(bad));
+});
+
+test("reminder body shows the start in the event zone and the location when set", () => {
+ const start = new Date("2026-11-02T14:30:00Z");
+ assert.equal(formatReminderBody(start, "America/New_York", ""), "Mon, Nov 2, 9:30 AM");
+ assert.equal(formatReminderBody(start, "America/New_York", " Room 4 "), "Mon, Nov 2, 9:30 AM · Room 4");
+ assert.match(formatReminderBody(start, "Not/AZone", ""), /2026-11-02/);
+});
diff --git a/worker.ts b/worker.ts
index 2d72196..0b6ac8b 100644
--- a/worker.ts
+++ b/worker.ts
@@ -27,6 +27,7 @@ import { runDriveTrashRetention } from "./src/lib/drive/retention";
import { runAccountRetention } from "./src/lib/accounts/deletion";
import { runJmapChangeRetention } from "./src/lib/jmap/changes";
import { runFollowUpReminders } from "./src/lib/follow-ups/service";
+import { runCalendarReminders } from "./src/lib/calendar/reminders";
export { RealtimeHub } from "./src/lib/realtime/hub";
export default {
@@ -140,6 +141,7 @@ export default {
ctx.waitUntil(runAgentMaintenance(env));
ctx.waitUntil(runTrashRetention(env, new Date(controller.scheduledTime)));
ctx.waitUntil(runFollowUpReminders(env, new Date(controller.scheduledTime)));
+ ctx.waitUntil(runCalendarReminders(env, new Date(controller.scheduledTime)));
ctx.waitUntil(sweepImportJobs(env, new Date(controller.scheduledTime)));
if (controller.cron === "0 2 * * *") ctx.waitUntil(runAccountRetention(env, new Date(controller.scheduledTime)));
// Drive trash is emptied once a day, with the 02:00 UTC cron; the 5-minute cron is for queue-like upkeep.