From a646186324ba1d8cbf725407d6918118196c4325 Mon Sep 17 00:00:00 2001 From: neviyn Date: Sun, 18 Apr 2021 21:37:48 +0100 Subject: [PATCH] Fixed event foreign key setup --- .../db/migration/V1_0__Database_Init.sql | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/main/resources/db/migration/V1_0__Database_Init.sql b/src/main/resources/db/migration/V1_0__Database_Init.sql index 5a37f3e..7ff8be1 100644 --- a/src/main/resources/db/migration/V1_0__Database_Init.sql +++ b/src/main/resources/db/migration/V1_0__Database_Init.sql @@ -62,17 +62,26 @@ create table if not exists projectplanner.team create table if not exists projectplanner.event ( - id bigserial not null - constraint event_pk - primary key - constraint event_project_fk - references projectplanner.project, - title varchar(255) not null, + id + bigserial + not + null + constraint + event_pk + primary + key, + title + varchar +( + 255 +) not null, description text, - project_id bigserial not null, + project_id bigserial not null + constraint event_project_fk + references projectplanner.project, start_time timestamp not null, end_time timestamp not null -); + ); create unique index if not exists event_id_uindex on projectplanner.event (id);