-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.rs
More file actions
83 lines (76 loc) · 1.86 KB
/
schema.rs
File metadata and controls
83 lines (76 loc) · 1.86 KB
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
table! {
candidates (id) {
id -> Uuid,
question_id -> Uuid,
candidate -> Varchar,
candidate_number -> Int8,
}
}
table! {
commitments (user_id, election_id, question_id) {
user_id -> Uuid,
election_id -> Uuid,
question_id -> Uuid,
forward_ballot -> Numeric,
reverse_ballot -> Numeric,
g_s -> Numeric,
g_s_prime -> Numeric,
g_s_s_prime -> Numeric,
single_vote_verified -> Bool,
published_ballots_verified -> Bool,
}
}
table! {
elections (id) {
id -> Uuid,
name -> Varchar,
created_by -> Uuid,
status -> Int4,
is_public -> Bool,
access_code -> Nullable<Varchar>,
generator -> Numeric,
prime -> Numeric,
location_modulus -> Numeric,
}
}
table! {
questions (id) {
id -> Uuid,
election_id -> Uuid,
question -> Varchar,
question_number -> Int8,
forward_cancelation_shares -> Numeric,
reverse_cancelation_shares -> Numeric,
}
}
table! {
registrations (user_id, election_id) {
user_id -> Uuid,
election_id -> Uuid,
}
}
table! {
users (id) {
id -> Uuid,
email -> Varchar,
hashed_password -> Varchar,
name -> Varchar,
refresh_secret -> Varchar,
}
}
joinable!(candidates -> questions (question_id));
joinable!(commitments -> elections (election_id));
joinable!(commitments -> questions (question_id));
joinable!(commitments -> users (user_id));
joinable!(elections -> users (created_by));
joinable!(questions -> elections (election_id));
joinable!(registrations -> elections (election_id));
joinable!(registrations -> users (user_id));
allow_tables_to_appear_in_same_query!(
candidates,
commitments,
elections,
questions,
registrations,
users,
);