summaryrefslogtreecommitdiff
path: root/jakob/dynamic/schema-poll.sql
blob: b15bdbd0ac746acfe4698e75a390b53710607753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
CREATE TABLE IF NOT EXISTS polls (
  id SERIAL,
  title varchar(128) NOT NULL,
  description varchar(16384) NOT NULL,
  datetime timestamp with time zone NOT NULL,
  questions varchar(16384) NOT NULL,
  PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS invitations (
  id SERIAL,
  vanity char(12) NOT NULL,
  comments varchar(1024) NOT NULL,
  created_on timestamp with time zone default current_timestamp,
  poll_id integer NOT NULL,
  PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS responses (
  id SERIAL,
  invitation_code char(12) NOT NULL,
  poll_id bigint NOT NULL,
  response varchar(16384) NOT NULL,
  PRIMARY KEY (id)
);

-- `questions` and `response` are s-expressions.