diff --git a/scripts/create-dev.sql b/scripts/create-dev.sql index 6053e76c63ee9ed3d07e452baba2054d71ca4e78..ebff9cfb1cbf8df5581635b06ef430bc8b0bdfba 100644 --- a/scripts/create-dev.sql +++ b/scripts/create-dev.sql @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS stocks; DROP TABLE IF EXISTS registry; DROP TABLE IF EXISTS transaction_types; DROP TABLE IF EXISTS accounts; @@ -40,6 +41,13 @@ CREATE TABLE registry ( FOREIGN KEY (account_id) REFERENCES accounts (id) ); +CREATE TABLE stocks ( + id INTEGER PRIMARY KEY, + item INTEGER NOT NULL, + quantity INTEGER NOT NULL, + FOREIGN KEY (item) REFERENCES items (ref) +); + INSERT INTO categories (id, name) VALUES (1, "Boissons"), (2, "Snacks"); @@ -78,3 +86,8 @@ INSERT INTO registry (id, dt, type, account_id, debit, credit, remarks) (9, datetime("2021-09-21 05:00:00"), 3, 7, 72.0, null, "Facture vente = Dette client"), (10, datetime("2021-09-21 05:30:00"), 4, 7, null, 72.0, "Encaissement de l'argent"), (11, datetime("2021-09-21 06:00:00"), 4, 2, 72.0, null, "= La dette du client est soldée"); + +INSERT INTO stocks (id, item, quantity) + VALUES(1, 1, 25), + VALUES(2, 2, 12), + VALUES(3, 3, 50); \ No newline at end of file