Changed Table Location for Parent-Child-Relation (Tree)

Testat 3 needs this.
This commit is contained in:
Patrick Keist 2019-06-08 12:15:19 +02:00
parent 92df3f1f0c
commit 9f84c47b69
2 changed files with 11 additions and 5 deletions

View File

@ -42,6 +42,7 @@ FOREIGN KEY (kundenkonto_fk) REFERENCES Kundenkonto(kundenkonto_id) ON DELETE CA
CREATE TABLE IF NOT EXISTS Location ( CREATE TABLE IF NOT EXISTS Location (
location_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, location_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
parent_location INT UNSIGNED,
address_fk INT UNSIGNED NOT NULL, address_fk INT UNSIGNED NOT NULL,
designation VARCHAR(45) NOT NULL, designation VARCHAR(45) NOT NULL,
building INT UNSIGNED NOT NULL, building INT UNSIGNED NOT NULL,

View File

@ -47,11 +47,12 @@ VALUES
(4,2), (4,2),
(5,1); (5,1);
INSERT INTO location( address_fk, designation, building, room) INSERT INTO location( parent_location, address_fk, designation, building, room)
VALUES VALUES
(1, 'Vertriebszentrum Tabak', 2, 4), (null, 1, 'Vertriebszentrum Tabak', 2, 4),
(2, 'Absteige',5,9), (1, 1, 'Logistik', 2, 5),
(3, 'Consult & Pepper', 6,9); (1, 2, 'Administration',1,9),
(1, 2, 'Buchhaltung', 1,8);
INSERT INTO pointofdelivery(customer_person_fk, contact_person_fk, location_fk, designation, timezone, timeZonePositiv, ntpServerIp) INSERT INTO pointofdelivery(customer_person_fk, contact_person_fk, location_fk, designation, timezone, timeZonePositiv, ntpServerIp)
@ -144,7 +145,11 @@ INSERT INTO v_logentries(pod, location, hostname, severity, `timestamp`, message
VALUES VALUES
("test1", "St. Gallen", "schokoladenweg", 5, now(), "Das ist eine aufwändige Aufgabe"), ("test1", "St. Gallen", "schokoladenweg", 5, now(), "Das ist eine aufwändige Aufgabe"),
("test2", "Appenzell", "Fählensee", 3, now(), "Gruss aus dem Alpstein"), ("test2", "Appenzell", "Fählensee", 3, now(), "Gruss aus dem Alpstein"),
("test3", "Abtwil", "Zbw", 3, now(), "Keine Lust mehr auf Schulabende.."); ("test3", "Abtwil", "Zbw", 3, now(), "Keine Lust mehr auf Schulabende.."),
("test4", "St. Gallen", "Zbw", 3, now(), "Hallo Gerät"),
("test5", "Abtwil", "Zbw", 3, now(), "Hallo User"),
("test6", "St. Gallen", "Zbw", 3, now(), "Hallo Welt"),
("test7", "St. Gallen", "Zbw", 3, now(), "Hallo Gerät");
INSERT INTO Interface (interface_id, network_fk, device_fk, ip_adress_v4, mac_adresse, isFullDuplex, bandwith, is_in_use, description) INSERT INTO Interface (interface_id, network_fk, device_fk, ip_adress_v4, mac_adresse, isFullDuplex, bandwith, is_in_use, description)
VALUES VALUES