diff --git a/cmd/exp/main.go b/cmd/exp/main.go index 2d7a0da..b18dcbb 100644 --- a/cmd/exp/main.go +++ b/cmd/exp/main.go @@ -10,15 +10,15 @@ import ( // Some experimentation code to figure out this API. func main() { p := fsrs.DefaultParam() - // p.EnableShortTerm = false - // p.EnableFuzz = true - // p.MaximumInterval = 365 * 5 + p.EnableShortTerm = false + p.EnableFuzz = true + p.MaximumInterval = 365 * 5 card := fsrs.NewCard() now := time.Now() card.Due = now f := fsrs.NewFSRS(p) - card.Stability = 1000000 - card.Difficulty = 1 + // card.Stability = 1000000 + // card.Difficulty = 1 card.State = fsrs.New // this needs to be set if changing the stab/diff manually. for range 10 { schedulingCards := f.Repeat(card, card.Due) diff --git a/db/migrations/000004_composite_idx_schedule.down.sql b/db/migrations/000004_composite_idx_schedule.down.sql new file mode 100644 index 0000000..8d7b6f9 --- /dev/null +++ b/db/migrations/000004_composite_idx_schedule.down.sql @@ -0,0 +1,5 @@ +BEGIN; + +DROP INDEX IF EXISTS idx_cards_user_lexicon_scheduled; + +COMMIT; \ No newline at end of file diff --git a/db/migrations/000004_composite_idx_schedule.up.sql b/db/migrations/000004_composite_idx_schedule.up.sql new file mode 100644 index 0000000..e10048e --- /dev/null +++ b/db/migrations/000004_composite_idx_schedule.up.sql @@ -0,0 +1,6 @@ +BEGIN; + +CREATE INDEX IF NOT EXISTS idx_cards_user_lexicon_scheduled + ON wordvault_cards (user_id, lexicon_name, next_scheduled); + +COMMIT; \ No newline at end of file