Yeah reworked the entire thing so that the checked, count and streak value is stored in the Habit Table
16 lines
486 B
SQL
16 lines
486 B
SQL
CREATE TABLE IF NOT EXISTS habits
|
|
(
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
list_id INTEGER NOT NULL,
|
|
name TEXT NOT NULL,
|
|
note TEXT,
|
|
times INTEGER NOT NULL,
|
|
unit INTEGER,
|
|
slot INTEGER NOT NULL,
|
|
checked BOOLEAN NOT NULL,
|
|
count INTEGER NOT NULL,
|
|
streak INTEGER NOT NULL,
|
|
created_at TEXT NOT NULL,
|
|
updated_at TEXT NOT NULL,
|
|
FOREIGN KEY (list_id) REFERENCES habit_lists(id)
|
|
); |