Property SchemaVersion

Assembly: redb.SQLite.dll

The schema version this build writes into PRAGMA user_version — the SQLite counterpart of
pvt_module_version(): the one number that says which upgrades a database file has had.
Bump it when gains a step; a database stamped with an
older number gets every step (they are idempotent), a current one skips the pass entirely.

public static int SchemaVersion { get; }

Remarks

1 — V4: hashes as BLOB(16) ().
2 — V4 (UNIQUE Э2): _structures._unique, _structures._unique_version, _values._unique BLOB(16),
the partial unique index, and the same two columns on _scheme_metadata_cache.
3 — V4 (UNIQUE Э1): _objects._value_unique and its partial unique index.
4 — V4 (LAZY Л2): _structures._lazy and _scheme_metadata_cache._lazy (the virtual marker).
5 — V4 (LAZY Л2): resync _scheme_metadata_cache._lazy from _structures (repairs caches
synced between the column upgrade and the marker write).
6 — V4 (LAZY Л2): stamp bump only. The SQLite metadata-cache WARMUP (Warmup_AllMetadataCaches)
carried a stale column list and re-nulled the marker after step 5 on files stamped 5;
the list is fixed and the resync of step 5 runs again for them.
7 — FK-column indexes IX__values__ListItem_not_null / IX__values__Object_not_null (partial):
without them every DELETE of a referenced object or list item scans the whole values
for the FK check (perf finding, 2026-09-10).
10 — the indexes another index of the same table fully replaces are dropped, the set PostgreSQL
dropped in its module 0.7.13 (2026-10-14).
11 — value-leading indexes IX__values__structure<value>_object for every value column, the set
PostgreSQL got in its module 0.7.16; the object-leading not_null, ix__values__array_null_structure
and the IX__values__scalar_object of SQLite Pro dropped (2026-10-17).
12 — IX__values__structure_object_string (partial, text values only): which objects hold a text value of a
field, without reading the text. A filter Field == null over a text field reads it (2026-10-21).
13 — the table _schema_compat: which builds a file still serves (). A build
whose schema version is below the file's leaves the file as it is and opens it when that row allows,
otherwise it stops with RedbSchemaNewerException (2026-11-14).
14 — _structures._renamed_from and _schemes._renamed_from: the previous names the sync records when it applies a
rename ([RedbRename], RedbScheme.RenamedFrom), read to stop a class older than the rename (2026-11-18).
15 — TimeOnly and TimeSpan as Ticks in _Long: _types._db_type and _scheme_metadata_cache.db_type say Long for
them. Older builds read and write them as text, so the file refuses them (
15, 2026-11-21).
16 — _schemes._version: the version of the Props class the scheme was last synchronised with
(RedbScheme.Version); the sync deletes a structure or changes its type only for a class of a higher version
(2026-11-29). Older builds ignore the column, so the oldest reader stays as it was.
17 — IX__values__array_parent_id is dropped where a non-partial index led by _array_parent_id remains
(IX__values__array_parent_index), the step PostgreSQL module 0.7.33 makes (2026-11-30).