Update tt/sql

This commit is contained in:
2023-02-26 16:06:41 +01:00
parent ad77a472ce
commit a9c818088f
2 changed files with 9 additions and 9 deletions

View File

@ -5,7 +5,7 @@ INSERT INTO wb_gl VALUES
(3, 'Falkensteiner Hügelland');
INSERT INTO branch VALUES
('M', 'Matzen');
('M', 'Matzen', 'AT', 224303541, 'Winzerstraße 1', '+4312345678');
INSERT INTO wine_attribute VALUES
('B', 'BIO AT-BIO-302', 10000),

View File

@ -220,11 +220,11 @@ CREATE TABLE branch (
zwstid TEXT NOT NULL CHECK (zwstid REGEXP '^[A-Z]$'),
name TEXT NOT NULL,
country TEXT,
postal_dest TEXT,
address TEXT,
country TEXT DEFAULT NULL,
postal_dest TEXT DEFAULT NULL,
address TEXT DEFAULT NULL,
phone_nr TEXT,
phone_nr TEXT DEFAULT NULL CHECK (phone_nr REGEXP '^\+[0-9]+$'),
CONSTRAINT pk_branch PRIMARY KEY (zwstid),
CONSTRAINT fk_branch_postal_dest FOREIGN KEY (country, postal_dest) REFERENCES postal_dest (country, id)
@ -280,10 +280,10 @@ CREATE TABLE member (
postal_dest TEXT NOT NULL,
address TEXT NOT NULL,
email TEXT CHECK (email REGEXP '^[^@\s]+@([a-z0-9_\x2Däöüß]+\.)+[a-z]{2,}$') DEFAULT NULL,
phone_landline TEXT CHECK (phone_landline REGEXP '^\+[0-9]+$') DEFAULT NULL,
phone_mobile_1 TEXT CHECK (phone_mobile_1 REGEXP '^\+[0-9]+$') DEFAULT NULL,
phone_mobile_2 TEXT CHECK (phone_mobile_2 REGEXP '^\+[0-9]+$') DEFAULT NULL,
email TEXT CHECK (email REGEXP '^[^@ ]+@([a-z0-9_\x2Däöüß]+\.)+[a-z]{2,}$') DEFAULT NULL,
phone_landline TEXT CHECK (phone_landline REGEXP '^\+[0-9]+$') DEFAULT NULL,
phone_mobile_1 TEXT CHECK (phone_mobile_1 REGEXP '^\+[0-9]+$') DEFAULT NULL,
phone_mobile_2 TEXT CHECK (phone_mobile_2 REGEXP '^\+[0-9]+$') DEFAULT NULL,
default_kgnr INTEGER CHECK (NOT active OR default_kgnr IS NOT NULL),
default_contact TEXT NOT NULL CHECK (default_contact IN ('email', 'post')) DEFAULT 'post',