-
Notifications
You must be signed in to change notification settings - Fork 1
/
spiapp-postgres.sql
100 lines (89 loc) · 2.43 KB
/
spiapp-postgres.sql
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
--
-- Name: members
--
CREATE SEQUENCE members_memid_seq;
CREATE TABLE members (
memid INTEGER PRIMARY KEY DEFAULT nextval('members_memid_seq'),
name character varying(50),
email character varying(50),
phone character varying(20),
password character varying(15),
pgpkey character varying(50),
firstdate date,
expirydate date,
ismember boolean DEFAULT FALSE NOT NULL,
iscontrib boolean DEFAULT FALSE NOT NULL,
ismanager boolean DEFAULT FALSE NOT NULL,
createvote boolean DEFAULT FALSE NOT NULL,
sub_private boolean DEFAULT FALSE,
lastactive date
);
ALTER SEQUENCE members_memid_seq OWNED BY members.memid;
--
-- Name: applications
--
CREATE SEQUENCE applications_appid_seq;
CREATE TABLE applications (
appid INTEGER PRIMARY KEY DEFAULT nextval('applications_appid_seq'),
appdate date,
member integer,
emailkey character varying(50),
emailkey_date date,
validemail boolean,
validemail_date date,
contrib text,
comment text,
lastchange date,
manager integer,
manager_date date,
approve boolean,
approve_date date,
contribapp boolean DEFAULT FALSE
);
ALTER SEQUENCE applications_appid_seq OWNED BY applications.appid;
--
-- Name: vote_election
--
CREATE SEQUENCE vote_election_ref_seq;
CREATE TABLE vote_election (
ref INTEGER PRIMARY KEY DEFAULT nextval('vote_election_ref_seq'),
title character varying(256) NOT NULL,
description text,
period_start timestamp with time zone,
period_stop timestamp with time zone,
owner integer NOT NULL,
winners integer DEFAULT 1 NOT NULL,
system integer NOT NULL
);
ALTER SEQUENCE vote_election_ref_seq OWNED BY vote_election.ref;
--
-- Name: vote_option
--
CREATE SEQUENCE vote_option_ref_seq;
CREATE TABLE vote_option (
ref INTEGER PRIMARY KEY DEFAULT nextval('vote_option_ref_seq'),
election_ref integer NOT NULL,
description text,
sort integer NOT NULL,
option_character character(1) NOT NULL
);
ALTER SEQUENCE vote_option_ref_seq OWNED BY vote_option.ref;
--
-- Name: vote_vote
--
CREATE TABLE vote_vote (
ref integer NOT NULL,
voter_ref integer,
election_ref integer NOT NULL,
private_secret character(32),
late_updated timestamp with time zone,
sent_notify boolean DEFAULT FALSE NOT NULL
);
--
-- Name: vote_voteoption
--
CREATE TABLE vote_voteoption (
vote_ref integer NOT NULL,
option_ref integer NOT NULL,
preference integer
);