Skip to content

Commit

Permalink
only prevent launching a database with a version under 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Dec 27, 2023
1 parent da2e952 commit 857b0e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/rs/core/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn maybe_update_db_inner(
}
}

if recorded_version < consts::CRSQLITE_VERSION && !is_blank_slate {
if recorded_version < consts::CRSQLITE_VERSION_0_15_0 && !is_blank_slate {
// todo: return an error message to the user that their version is
// not supported
let cstring = CString::new(format!("Opening a db created with cr-sqlite version {} is not supported. Upcoming release 0.15.0 is a breaking change.", recorded_version))?;
Expand Down
2 changes: 2 additions & 0 deletions core/rs/core/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub const TBL_SCHEMA: &'static str = "crsql_master";
// 00_05_01_01
pub const CRSQLITE_VERSION: i32 = 16_01_00;
pub const CRSQLITE_VERSION_STR: &'static str = "0.16.1";
pub const CRSQLITE_VERSION_0_15_0: i32 = 15_00_00;

pub const SITE_ID_LEN: i32 = 16;
pub const ROWID_SLAB_SIZE: i64 = 10000000000000;
// db version is a signed 64bit int since sqlite doesn't support saving and
Expand Down
2 changes: 1 addition & 1 deletion core/rs/core/src/sha.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// The sha of the commit that this version of crsqlite was built from.
pub const SHA: &'static str = "3a01980562615001d765eec61e3ed58147a93f93";
pub const SHA: &'static str = "da2e95270d76818cd487029ad3786e9463fa341b";

0 comments on commit 857b0e5

Please sign in to comment.