sql: remove price information

This commit is contained in:
King Kévin 2023-01-23 14:20:48 +01:00
parent 331f08109b
commit 0c581dff0b
1 changed files with 0 additions and 29 deletions

View File

@ -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