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