Skip to content

Commit 9b9e07d

Browse files
author
Ferenc Hammerl
committed
Create poll and participant tables
1 parent 4b31869 commit 9b9e07d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

dbconfig/create_tables.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
CREATE TABLE poll
2+
(
3+
id CHAR(16) NOT NULL,
4+
latest_change timestamp without time zone,
5+
initiated timestamp without time zone NOT NULL,
6+
hidden boolean NOT NULL,
7+
preferences_type text NOT NULL,
8+
state text NOT NULL,
9+
title text NOT NULL,
10+
PRIMARY KEY (id)
11+
);
12+
13+
CREATE TABLE participant
14+
(
15+
id SERIAL,
16+
name text NOT NULL,
17+
email text NOT NULL,
18+
poll_id character(16) NOT NULL,
19+
PRIMARY KEY (id),
20+
CONSTRAINT fk_participant_poll FOREIGN KEY (poll_id)
21+
REFERENCES public.poll (id) MATCH SIMPLE
22+
ON UPDATE NO ACTION
23+
ON DELETE NO ACTION
24+
NOT VALID
25+
)

0 commit comments

Comments
 (0)