Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only prevent initializing the extension with a version under 0.15 #420

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";