From 037cdf5dc2f90a9974733589f9bb944c1a260fe8 Mon Sep 17 00:00:00 2001 From: BEAUVAIS ANTOINE <antoine.beauvais@etu.unistra.fr> Date: Thu, 23 Sep 2021 19:08:14 +0200 Subject: [PATCH] Added a new table for stocks. --- scripts/create-dev.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/create-dev.sql b/scripts/create-dev.sql index 6053e76..ebff9cf 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 -- GitLab