update doc_db

This commit is contained in:
JBthePenguin 2021-09-02 15:24:41 +02:00
parent 27c9d653f7
commit 1e9c8d8553
3 changed files with 5 additions and 40 deletions

View file

@ -12,30 +12,9 @@ CREATE TABLE IF NOT EXISTS plugin_materiels_equipment (
FOREIGN KEY ( category_id ) REFERENCES plugin_materiels_category( id ) ON DELETE RESTRICT ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS plugin_materiels_entry (
id integer NOT NULL PRIMARY KEY autoincrement,
kind varchar(20) NOT NULL,
equipment_number integer NOT NULL,
equipment_id integer 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,
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
);
CREATE TABLE IF NOT EXISTS plugin_materiels_movement (
id integer NOT NULL PRIMARY KEY autoincrement,
side boolean NOT NULL CHECK(side IN(0,1)), /*0 -> entry, 1 -> output*/
side boolean NOT NULL CHECK(side IN(0,1)),
kind varchar(20) NOT NULL,
equipment_number integer NOT NULL,
equipment_id integer NOT NULL,