Fix table construction to closely mimic loop
This commit is contained in:
parent
d33c6a232e
commit
270635a17e
1 changed files with 13 additions and 13 deletions
|
@ -25,32 +25,32 @@ def create_tables(db):
|
|||
c = db.cursor()
|
||||
c.execute(
|
||||
""" CREATE TABLE IF NOT EXISTS Habits (
|
||||
id integer PRIMARY KEY,
|
||||
id integer PRIMARY KEY AUTOINCREMENT,
|
||||
archived integer,
|
||||
color integer,
|
||||
description text,
|
||||
freq_den integer,
|
||||
freq_num integer,
|
||||
highlight integer,
|
||||
name text NOT NULL,
|
||||
position integer UNIQUE,
|
||||
name text,
|
||||
position integer,
|
||||
reminder_hour integer,
|
||||
reminder_min integer,
|
||||
reminder_days integer,
|
||||
type integer,
|
||||
target_type integer,
|
||||
target_value real,
|
||||
unit text,
|
||||
reminder_days integer NOT NULL DEFAULT 127,
|
||||
type integer NOT NULL DEFAULT 0,
|
||||
target_type integer NOT NULL DEFAULT 0,
|
||||
target_value real NOT NULL DEFAULT 0,
|
||||
unit text NOT NULL DEFAULT "",
|
||||
question text,
|
||||
uuid text NOT NULL
|
||||
uuid text
|
||||
); """
|
||||
)
|
||||
c.execute(
|
||||
""" CREATE TABLE IF NOT EXISTS Repetitions (
|
||||
id integer PRIMARY KEY,
|
||||
habit integer,
|
||||
timestamp integer,
|
||||
value integer
|
||||
id integer PRIMARY KEY AUTOINCREMENT,
|
||||
habit integer NOT NULL REFERENCES Habits(id),
|
||||
timestamp integer NOT NULL,
|
||||
value integer NOT NULL
|
||||
); """
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue