RustBox database schema and migrations
RustBox keeps one complete fresh-install schema per supported SQL backend:
sqlite/schema.sqlmysql/schema.sqlpgsql/schema.sql
Compatibility baseline
The consolidated compatibility baseline is V052 (RustBox 0.2.23). Historical migrations up to and including V052 are already represented by the complete schema.sql files and are intentionally not shipped as standalone runtime migrations in this source tree:
- V047-V050 — attachment/search-outbox changes, folder counter generation, blob deletion outbox, compact-row and signature preferences (consolidated in 0.2.16);
- V051 —
display_preferences.adaptive_email_colors(default0) andmail_preferences.message_loading_mode(defaultpagination); - V052 — the
snoozed_messagestable used by Snooze (local cache state only, no IMAP side effects, no foreign keys).
Databases older than V052 must first be upgraded with a RustBox release that can reach V052. RustBox 0.2.22 accepts V050 and V051 databases and migrates them to V052, so a tenant that has not logged in since an older release should be opened once with 0.2.22 before upgrading. Tenants below the baseline are refused with an explicit error instead of being partially migrated.
The MySQL fresh schema now declares mail_preferences.message_loading_mode with an expression default (DEFAULT ('pagination')); MySQL rejects literal defaults on TEXT columns.
V053 — RustBox 0.2.23
V053 adds two appearance columns to display_preferences.
skin_depth, default standard, controls how far a predefined interface style may reshape the interface:
colors— only the style's palette is applied; layout, shapes and typography come from your own appearance settings;standard— palette plus the style's fixed layout preferences (the behavior of earlier releases);immersive— additionally applies the style's structural design tokens: typography, control and avatar shapes, floating panes, app-bar treatment, selection markers and backdrop.
skin_gradients, default 0 / off, is a separate switch for every gradient a style uses (backdrops, app bars, buttons, Roundcube Classic bevels). When off, each style falls back to flat colors defined next to its gradient.
Fresh installations already contain both columns in schema.sql and are registered at the latest schema version. Existing V052 tenants execute V053__skin_depth_and_gradients.sql.
The next migration number is V054.
Migration rules
Any future schema-changing release must:
- update all three complete
schema.sqlfiles; - add the same logical numbered migration for SQLite, MySQL and PostgreSQL;
- register that migration in
src/db/pool.rs; - extend the offline migration tests in
scripts/validate-release-static.py.
On MySQL, TEXT columns must use expression defaults such as DEFAULT ('value').