Small history table change
This commit is contained in:
1 parent
f9c4bf9c03
commit
bdf71fa0b7
3 files changed
+5
-4
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ create table history
|
|||||||
(
|
(
|
||||||
id INTEGER
|
id INTEGER
|
||||||
primary key autoincrement,
|
primary key autoincrement,
|
||||||
set_id INTEGER not null references decks on delete cascade,
|
deck_id INTEGER not null references decks on delete cascade,
|
||||||
word_id INTEGER not null references words on delete cascade,
|
word_id INTEGER not null references words on delete cascade,
|
||||||
timestamp INTEGER not null,
|
timestamp INTEGER not null,
|
||||||
answer INTEGER not null,
|
answer INTEGER not null,
|
||||||
|
|||||||
+2
-1
@@ -98,10 +98,11 @@ pub fn fill_state(state: &mut AppState) {
|
|||||||
let connection = state.connection.lock();
|
let connection = state.connection.lock();
|
||||||
|
|
||||||
let setting = load_settings(&connection);
|
let setting = load_settings(&connection);
|
||||||
|
drop(connection);
|
||||||
state.word_groups.write().start().unwrap();
|
state.word_groups.write().start().unwrap();
|
||||||
state.dictionary.write().start().unwrap();
|
state.dictionary.write().start().unwrap();
|
||||||
state.decks.write().start().unwrap();
|
state.decks.write().start().unwrap();
|
||||||
|
state.history.write().start().unwrap();
|
||||||
|
|
||||||
state.sync_data = Arc::new(RwLock::new(setting))
|
state.sync_data = Arc::new(RwLock::new(setting))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ pub type HistoryDataLayer = SqliteDbLayer<HistoryNote, HistoryQuerySet>;
|
|||||||
pub struct HistoryQuerySet;
|
pub struct HistoryQuerySet;
|
||||||
impl TableAccessQuerySet<HistoryNote> for HistoryQuerySet {
|
impl TableAccessQuerySet<HistoryNote> for HistoryQuerySet {
|
||||||
fn load() -> &'static str {
|
fn load() -> &'static str {
|
||||||
"SELECT rowid, set_id, state_id, timestamp, answer, before, after, fsrs FROM history"
|
"SELECT rowid, deck_id, word_id, timestamp, answer, before, after, fsrs FROM history"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn save() -> &'static str {
|
fn save() -> &'static str {
|
||||||
@@ -21,7 +21,7 @@ impl TableAccessQuerySet<HistoryNote> for HistoryQuerySet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn add() -> &'static str {
|
fn add() -> &'static str {
|
||||||
"INSERT INTO history (set_id, state_id, timestamp, answer, before, after, fsrs) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)"
|
"INSERT INTO history (deck_id, state_id, timestamp, answer, before, after, fsrs) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name() -> &'static str {
|
fn name() -> &'static str {
|
||||||
|
|||||||
Reference in new issue
Block a user