modify db and add doc for it

This commit is contained in:
JBthePenguin 2021-06-06 12:02:18 +02:00
parent 12a11611c6
commit 8dcd7670a5
10 changed files with 407 additions and 21 deletions

View file

@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS plugin_materiels_category (
CREATE TABLE IF NOT EXISTS plugin_materiels_equipment (
id integer NOT NULL PRIMARY KEY autoincrement,
category_id integer NOT NULL,
number_of_equipments integer NOT NULL,
stock_number integer NOT NULL,
designation varchar(255) NOT NULL,
CONSTRAINT u_equipment_designation UNIQUE ( designation ),
FOREIGN KEY ( category_id ) REFERENCES plugin_materiels_category( id ) ON DELETE RESTRICT ON UPDATE CASCADE
@ -16,17 +16,19 @@ CREATE TABLE IF NOT EXISTS plugin_materiels_equipment (
CREATE TABLE IF NOT EXISTS plugin_materiels_entry (
id integer NOT NULL PRIMARY KEY autoincrement,
kind varchar(20) NOT NULL,
number_of_equipments integer NOT NULL,
equipment_number integer NOT NULL,
equipment_id integer NOT NULL,
date_of_entry date NOT NULL,
entry_date date NOT NULL,
additional_comment varchar(255),
FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_equipment( id ) ON DELETE RESTRICT ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS plugin_materiels_output (
id integer NOT NULL PRIMARY KEY autoincrement,
kind varchar(20) NOT NULL,
number_of_equipments integer NOT NULL,
equipment_number integer NOT NULL,
equipment_id integer NOT NULL,
output_date date NOT NULL,
additional_comment varchar(255),
FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_equipment( id ) ON DELETE RESTRICT ON UPDATE CASCADE
);