-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sql
84 lines (81 loc) · 2.08 KB
/
setup.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
CREATE TABLE "users" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"username" TEXT,
"password" TEXT, -- sha256 hash of the plain-text password
"salt" TEXT -- salt that is appended to the password before it is hashed
);
CREATE TABLE "entries" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"form_id" INTEGER,
"user_id" INTEGER,
"house" TEXT,
"serial" TEXT,
"full_name" TEXT,
"national_id" TEXT,
"norm_national_id" TEXT,
"ward_village" TEXT,
"voter_list_number" TEXT,
"dob" TEXT,
"nationality" TEXT,
"religion" TEXT,
"education" TEXT,
"occupation" TEXT,
"address_perm" TEXT,
"address_mail" TEXT,
"constituency_name" TEXT,
"constituency_number" INTEGER,
"party" TEXT,
"mother" TEXT,
"mother_id" TEXT,
"mother_religion" TEXT,
"mother_ethnicity" TEXT,
"father" TEXT,
"father_id" TEXT,
"father_religion" TEXT,
"father_ethnicity" TEXT,
"finalized" INTEGER,
"saved" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE "forms" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"consensus_id" TEXT,
"approved" BOOLEAN DEFAULT 0,
"scan_file" TEXT,
"color_scan" TEXT,
"first_entry_id" INTEGER,
"second_entry_id" INTEGER,
"third_entry_id" INTEGER,
"entries_done" BOOLEAN DEFAULT 0
);
CREATE TABLE "consensus_forms" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"form_id" INTEGER,
"user_id" INTEGER,
"house" TEXT,
"serial" TEXT,
"full_name" TEXT,
"national_id" TEXT,
"norm_national_id" TEXT,
"ward_village" TEXT,
"voter_list_number" TEXT,
"dob" TEXT,
"nationality" TEXT,
"religion" TEXT,
"education" TEXT,
"occupation" TEXT,
"address_perm" TEXT,
"address_mail" TEXT,
"constituency_name" TEXT,
"constituency_number" INTEGER,
"party" TEXT,
"mother" TEXT,
"mother_id" TEXT,
"mother_religion" TEXT,
"mother_ethnicity" TEXT,
"father" TEXT,
"father_id" TEXT,
"father_religion" TEXT,
"father_ethnicity" TEXT,
"unknowns" TEXT,
"saved" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);