diff options
Diffstat (limited to 'fracture/db.py')
-rw-r--r-- | fracture/db.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fracture/db.py b/fracture/db.py index 56a268d..1e90727 100644 --- a/fracture/db.py +++ b/fracture/db.py @@ -24,6 +24,7 @@ def create(dbname): # date is %Y-%m-%d c.execute('''CREATE TABLE invoices ( id INTEGER NOT NULL, + id_repr TEXT NOT NULL, type TEXT NOT NULL, series INTEGER NOT NULL, date TEXT NOT NULL, @@ -32,7 +33,8 @@ def create(dbname): customer_id TEXT, customer_name TEXT, customer_address TEXT, - PRIMARY KEY(type, series, id) + PRIMARY KEY(type, series, id), + UNIQUE (id_repr, type) )''') c.execute('''CREATE TABLE taxes |