From 36af703718c7b852ecc5d7f51a43c59743bab19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20Rajkovi=C4=87?= Date: Sat, 5 Aug 2023 21:57:29 +0200 Subject: [PATCH] Updated prod migrations --- db/prod/v1_0.sql | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/db/prod/v1_0.sql b/db/prod/v1_0.sql index 884e623..23565b3 100644 --- a/db/prod/v1_0.sql +++ b/db/prod/v1_0.sql @@ -1,10 +1,23 @@ +CREATE TABLE IF NOT EXISTS "country" +( + id uuid, + iso_name char(2) UNIQUE NOT NULL, + name varchar(45) NOT NULL, + + primary key (id) + ); + CREATE TABLE IF NOT EXISTS "holiday" ( id uuid, - country char(2), - date date, - name varchar(64), + country char(2) NOT NULL, + date date NOT NULL, + name varchar(64) NOT NULL, description varchar(512), - is_state boolean, - is_religious boolean + is_state boolean NOT NULL, + is_religious boolean NOT NULL, + + primary key (id), + constraint fk_country_id foreign key (country) + references country(iso_name) on delete cascade on update cascade ); \ No newline at end of file