Record the baseline schema unless the database already carries a version.
(txn: &WriteTransaction)
| 219 | |
| 220 | /// Record the baseline schema unless the database already carries a version. |
| 221 | pub(crate) fn stamp_schema_version(txn: &WriteTransaction) -> PristineResult<()> { |
| 222 | let mut meta = txn.open_table(ATOMIC_META)?; |
| 223 | if meta.get(SCHEMA_VERSION_KEY)?.is_none() { |
| 224 | meta.insert( |
| 225 | SCHEMA_VERSION_KEY, |
| 226 | BASE_SCHEMA_VERSION.to_le_bytes().as_slice(), |
| 227 | )?; |
| 228 | } |
| 229 | Ok(()) |
| 230 | } |
| 231 | |
| 232 | /// Raise the schema fence in the same transaction as the projected-semantics |
| 233 | /// capability. This is monotonic: no operation may downgrade it later. |