M src/groceries/sqldb.py => src/groceries/sqldb.py +3 -2
@@ 24,9 24,10 @@ class SqliteDB:
)
conn.execute(
"CREATE TABLE items ("
+ "id INTEGER PRIMARY KEY, "
"list_id INTEGER NOT NULL REFERENCES lists, "
- "name TEXT, "
- "section TEXT, "
+ "name TEXT NOT NULL, "
+ "section TEXT NOT NULL, "
"priority INTEGER, "
"shop TEXT)"
)
M tests/conftest.py => tests/conftest.py +1 -0
@@ 32,6 32,7 @@ def groceries_file(tmpdir, items):
def create(conn):
conn.execute(
"CREATE TABLE items ("
+ "id INTEGER PRIMARY KEY, "
"list_id INTEGER, "
"name TEXT, "
"section TEXT, "