1 parent
6e74b33f03
commit
3b9110c8c8
44 files changed
+3057
-128
No files matched your search
@@ -23,7 +23,13 @@ V051 adds the preferences introduced in 0.2.16:
|
||||
|
||||
Fresh installations already contain the V051 columns in `schema.sql` and are registered at the latest schema version. Existing V050 tenants execute `V051__adaptive_email_colors_and_message_loading_mode.sql` before application queries use the new columns.
|
||||
|
||||
The next migration number is **V052**.
|
||||
## V052 — RustBox 0.2.22
|
||||
|
||||
V052 adds the `snoozed_messages` table used by the Snooze feature introduced in 0.2.22: a message can be hidden from its folder listing in the client until a chosen wake time, without being moved on the real IMAP server. The table is local cache state only (no IMAP side effects) and has no foreign keys, matching `message_tags`' existing exemption from forward-referencing foreign keys in the MySQL/PostgreSQL schemas.
|
||||
|
||||
Fresh installations already contain `snoozed_messages` in `schema.sql` and are registered at the latest schema version. Existing V051 tenants execute `V052__snooze.sql`.
|
||||
|
||||
The next migration number is **V053**.
|
||||
|
||||
## Migration rules
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE {{p}}snoozed_messages (
|
||||
id VARCHAR(64) PRIMARY KEY,
|
||||
message_uid BIGINT NOT NULL,
|
||||
message_folder VARCHAR(512) NOT NULL,
|
||||
wake_at BIGINT NOT NULL,
|
||||
created_at VARCHAR(64) NOT NULL DEFAULT (CAST(CURRENT_TIMESTAMP AS CHAR)),
|
||||
UNIQUE KEY idx_snoozed_messages_unique (message_uid, message_folder),
|
||||
INDEX idx_snoozed_messages_wake (wake_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -1,7 +1,7 @@
|
||||
-- RustBox 0.2.0 MySQL schema.
|
||||
-- One physical database contains global sessions plus isolated per-account tables.
|
||||
-- Application tables are materialized by replacing {{p}} with a collision-checked prefix.
|
||||
-- Squashed compatibility baseline: V050; current schema: V051.
|
||||
-- Squashed compatibility baseline: V050; current schema: V052.
|
||||
|
||||
-- RUSTBOX:GLOBAL-BEGIN
|
||||
CREATE TABLE IF NOT EXISTS rustbox_accounts (
|
||||
@@ -406,6 +406,16 @@ CREATE TABLE {{p}}saved_searches (
|
||||
updated_at VARCHAR(64) NOT NULL DEFAULT (CAST(CURRENT_TIMESTAMP AS CHAR))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE {{p}}snoozed_messages (
|
||||
id VARCHAR(64) PRIMARY KEY,
|
||||
message_uid BIGINT NOT NULL,
|
||||
message_folder VARCHAR(512) NOT NULL,
|
||||
wake_at BIGINT NOT NULL,
|
||||
created_at VARCHAR(64) NOT NULL DEFAULT (CAST(CURRENT_TIMESTAMP AS CHAR)),
|
||||
UNIQUE KEY idx_snoozed_messages_unique (message_uid, message_folder),
|
||||
INDEX idx_snoozed_messages_wake (wake_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE {{p}}special_folders (
|
||||
role VARCHAR(255) PRIMARY KEY,
|
||||
folder_name TEXT NOT NULL,
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE {{p}}snoozed_messages (
|
||||
id TEXT PRIMARY KEY,
|
||||
message_uid BIGINT NOT NULL,
|
||||
message_folder TEXT NOT NULL,
|
||||
wake_at BIGINT NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP::text),
|
||||
UNIQUE (message_uid, message_folder)
|
||||
);
|
||||
|
||||
CREATE INDEX {{p}}idx_snoozed_messages_wake ON {{p}}snoozed_messages(wake_at);
|
||||
@@ -1,7 +1,7 @@
|
||||
-- RustBox 0.2.0 PostgreSQL schema.
|
||||
-- One physical database contains global sessions plus isolated per-account tables.
|
||||
-- Application tables are materialized by replacing {{p}} with a collision-checked prefix.
|
||||
-- Squashed compatibility baseline: V050; current schema: V051.
|
||||
-- Squashed compatibility baseline: V050; current schema: V052.
|
||||
|
||||
-- RUSTBOX:GLOBAL-BEGIN
|
||||
CREATE TABLE IF NOT EXISTS rustbox_accounts (
|
||||
@@ -408,6 +408,15 @@ CREATE TABLE {{p}}saved_searches (
|
||||
updated_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP::text)
|
||||
);
|
||||
|
||||
CREATE TABLE {{p}}snoozed_messages (
|
||||
id TEXT PRIMARY KEY,
|
||||
message_uid BIGINT NOT NULL,
|
||||
message_folder TEXT NOT NULL,
|
||||
wake_at BIGINT NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP::text),
|
||||
UNIQUE (message_uid, message_folder)
|
||||
);
|
||||
|
||||
CREATE TABLE {{p}}special_folders (
|
||||
role TEXT PRIMARY KEY,
|
||||
folder_name TEXT NOT NULL,
|
||||
@@ -458,6 +467,8 @@ CREATE INDEX {{p}}idx_messages_in_reply_to ON {{p}}messages (in_reply_to);
|
||||
CREATE INDEX {{p}}idx_messages_message_id ON {{p}}messages (message_id);
|
||||
CREATE INDEX {{p}}idx_pgp_keys_email ON {{p}}pgp_keys (lower(email));
|
||||
CREATE UNIQUE INDEX {{p}}idx_saved_searches_name ON {{p}}saved_searches (name);
|
||||
|
||||
CREATE INDEX {{p}}idx_snoozed_messages_wake ON {{p}}snoozed_messages(wake_at);
|
||||
CREATE UNIQUE INDEX {{p}}idx_tags_imap_keyword ON {{p}}tags (imap_keyword) WHERE imap_keyword <> '';
|
||||
|
||||
-- RUSTBOX:TENANT-END
|
||||
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE {{p}}snoozed_messages (
|
||||
id TEXT PRIMARY KEY,
|
||||
message_uid INTEGER NOT NULL,
|
||||
message_folder TEXT NOT NULL,
|
||||
wake_at INTEGER NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
||||
UNIQUE (message_uid, message_folder)
|
||||
);
|
||||
|
||||
CREATE INDEX {{p}}idx_snoozed_messages_wake ON {{p}}snoozed_messages(wake_at);
|
||||
@@ -1,7 +1,7 @@
|
||||
-- RustBox 0.2.0 SQLite schema.
|
||||
-- One physical database contains global sessions plus isolated per-account tables.
|
||||
-- Application tables are materialized from the tenant section by replacing {{p}}.
|
||||
-- Squashed compatibility baseline: V050; current schema: V051.
|
||||
-- Squashed compatibility baseline: V050; current schema: V052.
|
||||
|
||||
-- RUSTBOX:GLOBAL-BEGIN
|
||||
CREATE TABLE IF NOT EXISTS rustbox_accounts (
|
||||
@@ -320,6 +320,15 @@ CREATE TABLE {{p}}saved_searches (
|
||||
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
CREATE TABLE {{p}}snoozed_messages (
|
||||
id TEXT PRIMARY KEY,
|
||||
message_uid INTEGER NOT NULL,
|
||||
message_folder TEXT NOT NULL,
|
||||
wake_at INTEGER NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
||||
UNIQUE (message_uid, message_folder)
|
||||
);
|
||||
|
||||
CREATE TABLE {{p}}special_folders (
|
||||
role TEXT PRIMARY KEY CHECK(role IN ('sent','drafts','trash','junk','archive')),
|
||||
folder_name TEXT NOT NULL,
|
||||
@@ -374,6 +383,8 @@ CREATE INDEX {{p}}idx_pgp_keys_email ON {{p}}pgp_keys(lower(email));
|
||||
|
||||
CREATE UNIQUE INDEX {{p}}idx_saved_searches_name ON {{p}}saved_searches(name COLLATE NOCASE);
|
||||
|
||||
CREATE INDEX {{p}}idx_snoozed_messages_wake ON {{p}}snoozed_messages(wake_at);
|
||||
|
||||
CREATE UNIQUE INDEX {{p}}idx_tags_imap_keyword ON {{p}}tags(imap_keyword) WHERE imap_keyword <> '';
|
||||
|
||||
-- RUSTBOX:TENANT-END
|
||||
Reference in new issue
Block a user