create table history ( id INTEGER primary key autoincrement, deck_id INTEGER not null references decks on delete cascade, word_id INTEGER not null references words on delete cascade, timestamp INTEGER not null, answer INTEGER not null, before INTEGER not null, after INTEGER not null, fsrs INTEGER not null );