1 parent
698e3c4a1b
commit
e3e844ef4f
31 files changed
+287
-75
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# Database schemas and migrations
|
||||
|
||||
RustBox 0.1.1 has one database backend for the whole application:
|
||||
RustBox 0.1.2 has one database backend for the whole application:
|
||||
|
||||
```text
|
||||
database_backend = sqlite | mysql | pgsql
|
||||
@@ -28,7 +28,6 @@ Every `schema.sql` is the complete schema for that engine. It contains:
|
||||
|
||||
Account data is isolated inside the selected physical database with a deterministic, collision-checked table prefix derived from the account hash. The `{{p}}` marker in the tenant part of each schema is replaced by RustBox at provisioning time. Sessions are global and therefore are not prefixed.
|
||||
|
||||
The SQLite baseline is structurally equivalent to the legacy V001-V046 migration chain. On first access, RustBox 0.1.1 imports an existing legacy `data_dir/<user_hash>/db.sqlite` at `PRAGMA user_version = 46` into the configured backend. Only after a successful import is the legacy file renamed to `db.sqlite.pre-0.1.1.bak`. Older legacy schemas must first be upgraded with RustBox 0.1.0.
|
||||
|
||||
## Future migrations
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- RustBox 0.1.1 MySQL schema.
|
||||
-- RustBox 0.1.2 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.
|
||||
-- Baseline application schema version: 46. Future migrations start at V047.
|
||||
@@ -333,7 +333,7 @@ CREATE TABLE {{p}}notification_preferences (
|
||||
CREATE TABLE {{p}}pgp_keys (
|
||||
fingerprint VARCHAR(255) PRIMARY KEY,
|
||||
key_id TEXT NOT NULL,
|
||||
email TEXT NOT NULL DEFAULT (''),
|
||||
email VARCHAR(320) NOT NULL DEFAULT '',
|
||||
user_id TEXT NOT NULL DEFAULT (''),
|
||||
public_key_armor LONGTEXT NOT NULL,
|
||||
secret_key_path TEXT,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- RustBox 0.1.1 PostgreSQL schema.
|
||||
-- RustBox 0.1.2 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.
|
||||
-- Baseline application schema version: 46. Future migrations start at V047.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- RustBox 0.1.1 SQLite schema.
|
||||
-- RustBox 0.1.2 SQLite schema.
|
||||
-- One physical database contains global sessions plus isolated per-account tables.
|
||||
-- Application tables are materialized from the tenant section by replacing {{p}}.
|
||||
-- Baseline application schema version: 46. Future migrations start at V047.
|
||||
|
||||
Reference in new issue
Block a user