diff --git a/pylib/tests/test_schedv1.py b/pylib/tests/test_schedv1.py index 4a7e792a3..b88d3cf97 100644 --- a/pylib/tests/test_schedv1.py +++ b/pylib/tests/test_schedv1.py @@ -13,7 +13,6 @@ def getEmptyCol(): col = getEmptyColOrig() # only safe in test environment col.set_config("schedVer", 1) - col._loadScheduler() return col diff --git a/rslib/src/config.rs b/rslib/src/config.rs index f84728b68..925dde90c 100644 --- a/rslib/src/config.rs +++ b/rslib/src/config.rs @@ -18,7 +18,7 @@ use slog::warn; /// new config variables, you do not need to add them here - /// just create an accessor function below with an appropriate /// default on missing/invalid values instead. -pub(crate) fn schema11_config_as_string(creation_offset: Option) -> String { +pub(crate) fn schema11_config_as_string() -> String { let obj = json!({ "activeDecks": [1], "curDeck": 1, @@ -33,8 +33,7 @@ pub(crate) fn schema11_config_as_string(creation_offset: Option) -> String "sortBackwards": false, "addToCur": true, "dayLearnFirst": false, - "schedVer": 2, - "creationOffset": creation_offset, + "schedVer": 1, }); serde_json::to_string(&obj).unwrap() } diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index e1144e49d..6695538de 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -1,10 +1,10 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +use crate::config::schema11_config_as_string; use crate::err::Result; use crate::err::{AnkiError, DBErrorKind}; use crate::timestamp::{TimestampMillis, TimestampSecs}; -use crate::{config::schema11_config_as_string, sched::cutoff::local_minutes_west_for_stamp}; use crate::{i18n::I18n, sched::cutoff::v1_creation_date, text::without_combining}; use regex::Regex; use rusqlite::{functions::FunctionFlags, params, Connection, NO_PARAMS}; @@ -166,18 +166,13 @@ impl SqliteStorage { db.execute_batch(include_str!("schema11.sql"))?; // start at schema 11, then upgrade below let crt = v1_creation_date(); - let offset = if server { - None - } else { - Some(local_minutes_west_for_stamp(crt)) - }; db.execute( "update col set crt=?, scm=?, ver=?, conf=?", params![ crt, TimestampMillis::now(), SCHEMA_STARTING_VERSION, - &schema11_config_as_string(offset) + &schema11_config_as_string() ], )?; }