WIP: EOL
This commit is contained in:
parent
7ed1e05284
commit
49e05cac10
23 changed files with 613 additions and 253 deletions
|
|
@ -10,40 +10,52 @@ CREATE TABLE IF NOT EXISTS training.trainings (
|
|||
price decimal NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS training.prices (
|
||||
training_id UUID REFERENCES training.trainings(id),
|
||||
amount NUMERIC(6, 4) NOT NULL,
|
||||
currency VARCHAR(3) NOT NULL,
|
||||
CHECK (currency IN ('USD', 'EUR', 'CZK'))
|
||||
type VARCHAR(10) NOT NULL,
|
||||
CHECK (type IN ('OPEN', 'CORPORATE', 'STUDENT', 'GOVERNMENT'))
|
||||
PRIMARY KEY (training_id, currency, type) -- composite primary key
|
||||
)
|
||||
|
||||
CREATE TABLE IF NOT EXISTS training.dates (
|
||||
id UUID PRIMARY KEY,
|
||||
training_id UUID NOT NULL,
|
||||
date date NOT NULL,
|
||||
start_time time NOT NULL,
|
||||
days smallint NOT NULL,
|
||||
price decimal NOT NULL,
|
||||
is_online boolean NOT NULL,
|
||||
location varchar(255) NOT NULL,
|
||||
address varchar(255) NOT NULL,
|
||||
capacity smallint NOT NULL,
|
||||
date DATE NOT NULL,
|
||||
start_time TIME NOT NULL,
|
||||
days SMALLINT NOT NULL,
|
||||
is_online BOOLEAN NOT NULL,
|
||||
location VARCHAR(255) NOT NULL,
|
||||
address VARCHAR(255) NOT NULL,
|
||||
capacity SMALLINT NOT NULL,
|
||||
amount NUMERIC(6, 4) NOT NULL,
|
||||
currency VARCHAR(3) NOT NULL,
|
||||
CHECK (currency IN ('USD', 'EUR', 'CZK'))
|
||||
FOREIGN KEY (training_id) REFERENCES training.trainings(id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS training.attendees (
|
||||
id UUID PRIMARY KEY,
|
||||
date_id UUID NOT NULL,
|
||||
name varchar(255) NOT NULL,
|
||||
email varchar(255) NOT NULL,
|
||||
company varchar(255) NOT NULL,
|
||||
role varchar(255) NOT NULL,
|
||||
is_student boolean NOT NULL,
|
||||
has_attended boolean NOT NULL,
|
||||
has_paid boolean NOT NULL,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
company VARCHAR(255) NOT NULL,
|
||||
role VARCHAR(255) NOT NULL,
|
||||
is_student BOOLEAN NOT NULL,
|
||||
has_attended BOOLEAN NOT NULL,
|
||||
has_paid BOOLEAN NOT NULL,
|
||||
FOREIGN KEY (date_id) REFERENCES training.dates(id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS training.feedback (
|
||||
id UUID PRIMARY KEY,
|
||||
attendee_id UUID NOT NULL,
|
||||
rating smallint NOT NULL,
|
||||
comment text NOT NULL,
|
||||
is_anonymous boolean NOT NULL,
|
||||
is_sharing_allowed boolean NOT NULL,
|
||||
rating SMALLINT NOT NULL,
|
||||
comment TEXT NOT NULL,
|
||||
is_anonymous BOOLEAN NOT NULL,
|
||||
is_sharing_allowed BOOLEAN NOT NULL,
|
||||
FOREIGN KEY (attendee_id) REFERENCES training.attendees(id)
|
||||
);
|
||||
|
||||
|
|
|
|||
Reference in a new issue