~javiljoen/shopping-list

6931d0bcbd49c0b90ab789d19b740c20fe4d78b9 — JA Viljoen 1 year, 4 months ago 67f3498 master python
Add id field to items table in db schema
2 files changed, 4 insertions(+), 2 deletions(-)

M src/groceries/sqldb.py
M tests/conftest.py
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, "