migrate.rs

 1//! Loro-backed storage does not use SQL schema migrations.
 2//!
 3//! The old SQLite migration flow has been replaced by document-level metadata
 4//! (`meta.schema_version`) in the Loro snapshot. This module remains only as a
 5//! compatibility shim for call sites that still invoke migration entry points.
 6
 7use anyhow::Result;
 8
 9/// No-op compatibility function for legacy call sites.
10pub fn migrate_up<T>(_conn: &mut T) -> Result<()> {
11    Ok(())
12}
13
14/// No-op compatibility function for legacy call sites.
15pub fn migrate_down<T>(_conn: &mut T, _target_version: u32) -> Result<()> {
16    Ok(())
17}
18
19#[cfg(test)]
20mod tests {
21    use super::*;
22
23    #[test]
24    fn compatibility_noops_succeed() {
25        let mut placeholder = ();
26        migrate_up(&mut placeholder).unwrap();
27        migrate_down(&mut placeholder, 0).unwrap();
28    }
29}