holiday-api/db/prod/v1_0.sql

23 lines
508 B
MySQL
Raw Normal View History

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-08-06 11:20:11 +00:00
);
2023-08-05 19:57:29 +00:00
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),
2023-08-06 11:20:11 +00:00
constraint fk_country_id
foreign key (cuntry(iso_name) on delete cascade on update cascade
2023-07-11 19:40:15 +00:00
);