MCPcopy Create free account
hub / github.com/erans/pgsqlite / check_schema_version

Method check_schema_version

src/migration/runner.rs:25–41  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

23 }
24
25 pub fn check_schema_version(&self) -> Result<()> {
26 // Ensure metadata tables exist to check version
27 self.ensure_metadata_tables()?;
28
29 let current_version = self.get_current_version()?;
30 let target_version = *MIGRATIONS.keys().max().unwrap_or(&0);
31
32 if current_version < target_version {
33 return Err(anyhow!(
34 "Database schema is outdated. Current version: {}, Required version: {}. \
35 Please run with --migrate to update the schema.",
36 current_version, target_version
37 ));
38 }
39
40 Ok(())
41 }
42
43 pub fn run_pending_migrations(&mut self) -> Result<Vec<u32>> {
44 // Create metadata tables if they don't exist (for new databases)

Calls 3

get_current_versionMethod · 0.80
keysMethod · 0.80

Tested by 2