sql: remove price information
This commit is contained in:
parent
331f08109b
commit
0c581dff0b
29
schema.sql
29
schema.sql
|
@ -78,35 +78,6 @@ CREATE TABLE IF NOT EXISTS stock (
|
|||
FOREIGN KEY (distribution) REFERENCES distribution (id)
|
||||
);
|
||||
|
||||
-- price currency
|
||||
CREATE TABLE IF NOT EXISTS currency (
|
||||
id INTEGER AUTO_INCREMENT PRIMARY KEY, -- index
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- currency rate
|
||||
CREATE TABLE IF NOT EXISTS rate (
|
||||
origin INTEGER NOT NULL, -- from
|
||||
destination INTEGER NOT NULL, -- to
|
||||
rate REAL NOT NULL, -- 1 from = rate to
|
||||
date DATETIME NOT NULL, -- date of the rate
|
||||
FOREIGN KEY (origin) REFERENCES currency (id),
|
||||
FOREIGN KEY (destination) REFERENCES currency (id)
|
||||
);
|
||||
|
||||
-- part price at a distributor
|
||||
CREATE TABLE IF NOT EXISTS price (
|
||||
id INTEGER AUTO_INCREMENT PRIMARY KEY, -- index
|
||||
distribution INTEGER NOT NULL, -- the part
|
||||
quantity INTEGER NOT NULL, -- the minimum number of part for this price
|
||||
price REAL NOT NULL, -- the unit price
|
||||
currency INTEGER NOT NULL,
|
||||
date DATETIME NOT NULL,
|
||||
FOREIGN KEY (distribution) REFERENCES distribution (id),
|
||||
FOREIGN KEY (currency) REFERENCES currency (id)
|
||||
);
|
||||
|
||||
-- document types
|
||||
CREATE TABLE IF NOT EXISTS document (
|
||||
id INTEGER AUTO_INCREMENT PRIMARY KEY, -- index
|
||||
type TEXT -- document type
|
||||
|
|
Loading…
Reference in New Issue