diff options
author | Sebastian Reichel <sre@ring0.de> | 2015-09-13 23:05:18 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2015-09-13 23:05:18 +0200 |
commit | 1ea4fdf8072d6be99a13cc796c9775c05f8c9498 (patch) | |
tree | b743630f1813670d6034717da829b17bc33e906b /sql | |
parent | 9dce0dfa4cd90e7ce2131e1e5821f54eb3754b26 (diff) | |
download | serial-barcode-scanner-1ea4fdf8072d6be99a13cc796c9775c05f8c9498.tar.bz2 |
Add support for aliased EANs
Some products are sold under different EANs (e.g. per-country EANs).
The alias table can be used to map multiple EANs to a single product.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/tables.sql | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/tables.sql b/sql/tables.sql index a81d60c..ac9a8c2 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -7,5 +7,6 @@ CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY NOT NULL, email TEXT, f CREATE TABLE IF NOT EXISTS authentication(user INTEGER PRIMARY KEY NOT NULL REFERENCES users, password TEXT, session CHARACTER(20), superuser BOOLEAN NOT NULL DEFAULT 0, auth_users BOOLEAN NOT NULL DEFAULT 0, auth_products BOOLEAN NOT NULL DEFAULT 0, auth_cashbox BOOLEAN NOT NULL DEFAULT 0, disabled BOOLEAN NOT NULL DEFAULT 0); CREATE TABLE IF NOT EXISTS supplier(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, city TEXT, postal_code TEXT, street TEXT, phone TEXT, website TEXT); CREATE TABLE IF NOT EXISTS cashbox_diff(id INTEGER PRIMARY KEY AUTOINCREMENT, user INTEGER NOT NULL REFERENCES users, amount INTEGER NOT NULL, timestamp INTEGER NOT NULL DEFAULT 0); +CREATE TABLE IF NOT EXISTS ean_aliases (id INTEGER PRIMARY KEY NOT NULL, real_ean INTEGER NOT NULL REFERENCES products); CREATE INDEX IF NOT EXISTS invoiceindex ON sales (user ASC, timestamp DESC); COMMIT; |