diff --git a/db/schema/8-asset.sql b/db/schema/8-asset.sql index 3aea924..0e14635 100644 --- a/db/schema/8-asset.sql +++ b/db/schema/8-asset.sql @@ -55,6 +55,7 @@ CREATE TABLE IF NOT EXISTS resource_property ( -- consumable Supplier CREATE TABLE IF NOT EXISTS supply ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + avinya_type_id INT DEFAULT NULL, asset_id INT DEFAULT NULL, consumable_id INT DEFAULT NULL, supplier_id INT DEFAULT NULL, @@ -65,6 +66,7 @@ CREATE TABLE IF NOT EXISTS supply ( order_amount INT DEFAULT 0, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + FOREIGN KEY (avinya_type_id) REFERENCES avinya_type(id), FOREIGN KEY (asset_id) REFERENCES asset(id), FOREIGN KEY (consumable_id) REFERENCES consumable(id), FOREIGN KEY (supplier_id) REFERENCES supplier(id), diff --git a/db/schema/9-avinya_types.sql b/db/schema/9-avinya_types.sql index c6544f8..a43f102 100644 --- a/db/schema/9-avinya_types.sql +++ b/db/schema/9-avinya_types.sql @@ -60,6 +60,7 @@ INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, level) VALUES ('asset', 'laptop', 'Laptop', 'academic', 'empower', 700); INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, level) VALUES ('asset', 'accessories', 'Accessories', 'academic', 'empower', 500); INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, level) VALUES ('asset', 'stationary', 'Stationary', 'academic', 'empower', 400); +INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, level) VALUES ('asset', 'sim', 'Sim', 'academic', 'empower', 550); INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, level) VALUES ('Arrival', 'arrival', 'meeting', 'academic', null, 3500); INSERT INTO avinya_type (description, name, global_type, foundation_type, focus, level) VALUES ('Departure', 'departure', 'meeting', 'academic', null, 3500);