Some Changes in Table Customers for RegEx-Testat
This commit is contained in:
parent
79abc07194
commit
15d5cc48c5
@ -30,14 +30,15 @@ CREATE Table IF NOT EXISTS Kundenkonto (
|
|||||||
kundenkonto_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT);
|
kundenkonto_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT);
|
||||||
|
|
||||||
CREATE Table IF NOT EXISTS Customer (
|
CREATE Table IF NOT EXISTS Customer (
|
||||||
person_fk INT UNSIGNED NOT NULL,
|
customer_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||||
address_fk INT UNSIGNED NOT NULL,
|
firstname VARCHAR(45) NOT NULL,
|
||||||
|
lastname VARCHAR(45) NOT NULL,
|
||||||
|
addressnumber VARCHAR(45) NOT NULL,
|
||||||
kundenkonto_fk INT UNSIGNED NOT NULL,
|
kundenkonto_fk INT UNSIGNED NOT NULL,
|
||||||
tel VARCHAR(20),
|
tel VARCHAR(20),
|
||||||
eMail VARCHAR(30),
|
eMail VARCHAR(70),
|
||||||
url VARCHAR(30),
|
url VARCHAR(70),
|
||||||
FOREIGN KEY (person_fk) REFERENCES Person(Person_id) ON DELETE CASCADE,
|
`password` VARCHAR(255),
|
||||||
FOREIGN KEY (address_fk) REFERENCES Address(address_id) ON DELETE CASCADE,
|
|
||||||
FOREIGN KEY (kundenkonto_fk) REFERENCES Kundenkonto(kundenkonto_id) ON DELETE CASCADE);
|
FOREIGN KEY (kundenkonto_fk) REFERENCES Kundenkonto(kundenkonto_id) ON DELETE CASCADE);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS Location (
|
CREATE TABLE IF NOT EXISTS Location (
|
||||||
@ -59,15 +60,15 @@ FOREIGN KEY (person_fk) REFERENCES Person(person_id)ON DELETE CASCADE
|
|||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS PointOfDelivery (
|
CREATE TABLE IF NOT EXISTS PointOfDelivery (
|
||||||
pod_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
pod_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
customer_person_fk INT UNSIGNED NOT NULL,
|
customer_id_fk INT UNSIGNED NOT NULL,
|
||||||
contact_person_fk INT UNSIGNED NOT NULL,
|
contact_id_fk INT UNSIGNED NOT NULL,
|
||||||
location_fk INT UNSIGNED NOT NULL,
|
location_fk INT UNSIGNED NOT NULL,
|
||||||
designation VARCHAR(45),
|
designation VARCHAR(45),
|
||||||
timezone TIME NOT NULL,
|
timezone TIME NOT NULL,
|
||||||
timeZonePositiv TINYINT NOT NULL,
|
timeZonePositiv TINYINT NOT NULL,
|
||||||
ntpServerIp VARCHAR(20),
|
ntpServerIp VARCHAR(20),
|
||||||
FOREIGN KEY (`customer_person_fk`) REFERENCES `customer`(`person_fk`)ON DELETE CASCADE,
|
FOREIGN KEY (`customer_id_fk`) REFERENCES `customer`(`customer_id`)ON DELETE CASCADE,
|
||||||
FOREIGN KEY (`contact_person_fk`) REFERENCES `contact`(`contact_id`)ON DELETE CASCADE,
|
FOREIGN KEY (`contact_id_fk`) REFERENCES `contact`(`contact_id`)ON DELETE CASCADE,
|
||||||
FOREIGN KEY (`location_fk`) REFERENCES `location`(`location_id`) ON DELETE CASCADE
|
FOREIGN KEY (`location_fk`) REFERENCES `location`(`location_id`) ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -32,12 +32,12 @@ INSERT INTO kundenkonto(kundenkonto_id)
|
|||||||
VALUES
|
VALUES
|
||||||
(1),(2),(3),(4),(5),(6),(7),(8);
|
(1),(2),(3),(4),(5),(6),(7),(8);
|
||||||
|
|
||||||
INSERT INTO customer(person_fk, address_fk, kundenkonto_fk, tel, eMail, url)
|
INSERT INTO customer(firstname, lastname, addressnumber, kundenkonto_fk, tel, eMail, url)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 2, 3, '079 666 20 14', 'nina.schmid@test.ch','www.nina.ch'),
|
('Nina','Schmid', 2, 3, '079 666 20 14', 'nina.schmid@test.ch','www.nina.ch'),
|
||||||
(2, 1, 1, 'Dose mit Schnur', 'bilbo@auenland.xx',null),
|
('Bilbo','Beutlin', 1, 1, 'Dose mit Schnur', 'bilbo@auenland.xx','https://de.wikipedia.org/wiki/Auenland'),
|
||||||
(3, 3, 2, '078 878 90 43', 'p.keist@hotmail.com',null),
|
('Max','Muster', 3, 2, '078 878 90 43', 'test@test.ch', null),
|
||||||
(6, 4, 4, '077 777 77 77', 'ronny@wyss.ch',null);
|
('Patrick','Keist', 4, 4, '077 777 77 77', 'p.keist@hotmail.com','https://www.keist.com');
|
||||||
|
|
||||||
INSERT INTO contact( person_fk, priority)
|
INSERT INTO contact( person_fk, priority)
|
||||||
VALUES
|
VALUES
|
||||||
@ -49,22 +49,16 @@ VALUES
|
|||||||
|
|
||||||
INSERT INTO location( parent_location, address_fk, designation, building, room)
|
INSERT INTO location( parent_location, address_fk, designation, building, room)
|
||||||
VALUES
|
VALUES
|
||||||
(null, 1, 'Vertriebszentrum Tabak', 2, 4),
|
(0, 1, 'Vertriebszentrum Tabak', 2, 4),
|
||||||
(1, 2, 'Logistik', 2, 5),
|
(1, 1, 'Logistik', 2, 5),
|
||||||
(1, 3, 'Administration',1,9),
|
(2, 2, 'Buchhaltung2', 1,8),
|
||||||
(1, 4, 'Buchhaltung', 1,8),
|
(1, 2, 'Administration',1,9),
|
||||||
(2, 2, 'Logistik_Büro1', 2,5),
|
(1, 2, 'Buchhaltung1', 1,8),
|
||||||
(2, 2, 'Logistik_Büro2', 2,6),
|
(2, 2, 'Buchhaltung3', 1,8),
|
||||||
(2, 2, 'Logistik_Büro3', 2,7),
|
(6, 2, 'Buchhaltung4', 1,8);
|
||||||
(3, 3, 'Administration_Büro1', 1,1),
|
|
||||||
(3, 3, 'Administration_Büro2', 1,2),
|
|
||||||
(3, 3, 'Administration_Büro3', 1,3),
|
|
||||||
(4, 4, 'Buchhaltung_Büro1', 1,1),
|
|
||||||
(4, 4, 'Buchhaltung_Büro1', 1,1)
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO pointofdelivery(customer_person_fk, contact_person_fk, location_fk, designation, timezone, timeZonePositiv, ntpServerIp)
|
INSERT INTO pointofdelivery(customer_id_fk, contact_id_fk, location_fk, designation, timezone, timeZonePositiv, ntpServerIp)
|
||||||
VALUES
|
VALUES
|
||||||
(2,2,1,'Auenland','10:00:00',1, '1.1.1.10'),
|
(2,2,1,'Auenland','10:00:00',1, '1.1.1.10'),
|
||||||
(1,1,3, 'Consult & Pepper Trogen', '01:00:00', 1 , '178.198.222.68'),
|
(1,1,3, 'Consult & Pepper Trogen', '01:00:00', 1 , '178.198.222.68'),
|
||||||
|
Loading…
Reference in New Issue
Block a user