2023-08-05 19:57:29 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS "country"
|
|
|
|
(
|
|
|
|
id uuid,
|
|
|
|
iso_name char(2) UNIQUE NOT NULL,
|
|
|
|
name varchar(45) NOT NULL,
|
|
|
|
|
|
|
|
primary key (id)
|
|
|
|
);
|
|
|
|
|
2023-07-11 19:40:15 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS "holiday"
|
|
|
|
(
|
|
|
|
id uuid,
|
2023-08-05 19:57:29 +00:00
|
|
|
country char(2) NOT NULL,
|
|
|
|
date date NOT NULL,
|
|
|
|
name varchar(64) NOT NULL,
|
2023-07-11 19:40:15 +00:00
|
|
|
description varchar(512),
|
2023-08-05 19:57:29 +00:00
|
|
|
is_state boolean NOT NULL,
|
|
|
|
is_religious boolean NOT NULL,
|
|
|
|
|
|
|
|
primary key (id),
|
|
|
|
constraint fk_country_id foreign key (country)
|
2023-08-05 20:10:15 +00:00
|
|
|
references co
|
|
|
|
|
|
|
|
primary key (id)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS "holiday"
|
|
|
|
(
|
|
|
|
id uuid,
|
|
|
|
country char(2) NOT NULL,
|
|
|
|
date date NOT NULL,
|
|
|
|
name varchar(64) NOT NULL,
|
|
|
|
description varchar(512),
|
|
|
|
is_state boolean NOT NULL,
|
|
|
|
is_religious boolean NOT NULL,
|
|
|
|
|
|
|
|
primary key (id),
|
|
|
|
constraint fk_country_id foreign key (cuntry(iso_name) on delete cascade on update cascade
|
2023-07-11 19:40:15 +00:00
|
|
|
);
|