author | Michael Krelin <hacker@klever.net> | 2013-11-27 17:11:26 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2013-11-27 17:11:26 (UTC) |
commit | 0f1cc2ac41835ee8fa5dded1593fa95092b54bbe (patch) (unidiff) | |
tree | 8563cd1578aad126c803be452dedd3b9dd9e0921 /backend/node/src/clipperz.schema.sql | |
parent | b59defff1efe85e43850243910007dd1fe3a4ef2 (diff) | |
download | clipperz-0f1cc2ac41835ee8fa5dded1593fa95092b54bbe.zip clipperz-0f1cc2ac41835ee8fa5dded1593fa95092b54bbe.tar.gz clipperz-0f1cc2ac41835ee8fa5dded1593fa95092b54bbe.tar.bz2 |
switched postgresql schema from json type to plaintext
Diffstat (limited to 'backend/node/src/clipperz.schema.sql') (more/less context) (ignore whitespace changes)
-rw-r--r-- | backend/node/src/clipperz.schema.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/node/src/clipperz.schema.sql b/backend/node/src/clipperz.schema.sql index 1c2305c..591828a 100644 --- a/backend/node/src/clipperz.schema.sql +++ b/backend/node/src/clipperz.schema.sql | |||
@@ -1,32 +1,32 @@ | |||
1 | CREATE SCHEMA clipperz; | 1 | CREATE SCHEMA clipperz; |
2 | 2 | ||
3 | CREATE TABLE clipperz.theuser ( | 3 | CREATE TABLE clipperz.theuser ( |
4 | u_id serial PRIMARY KEY, | 4 | u_id serial PRIMARY KEY, |
5 | u_name varchar NOT NULL UNIQUE, | 5 | u_name varchar NOT NULL UNIQUE, |
6 | u_srp_s varchar NOT NULL, | 6 | u_srp_s varchar NOT NULL, |
7 | u_srp_v varchar NOT NULL, | 7 | u_srp_v varchar NOT NULL, |
8 | u_header json NOT NULL, | 8 | u_header varchar NOT NULL, |
9 | u_statistics varchar NOT NULL, | 9 | u_statistics varchar NOT NULL, |
10 | u_authversion varchar NOT NULL, | 10 | u_authversion varchar NOT NULL, |
11 | u_version varchar NOT NULL, | 11 | u_version varchar NOT NULL, |
12 | u_lock varchar NOT NULL | 12 | u_lock varchar NOT NULL |
13 | ); | 13 | ); |
14 | 14 | ||
15 | CREATE TABLE clipperz.therecord ( | 15 | CREATE TABLE clipperz.therecord ( |
16 | r_id serial PRIMARY KEY, | 16 | r_id serial PRIMARY KEY, |
17 | u_id integer NOT NULL REFERENCES clipperz.theuser(u_id) ON UPDATE CASCADE ON DELETE CASCADE, | 17 | u_id integer NOT NULL REFERENCES clipperz.theuser(u_id) ON UPDATE CASCADE ON DELETE CASCADE, |
18 | r_ref varchar NOT NULL UNIQUE, | 18 | r_ref varchar NOT NULL UNIQUE, |
19 | r_data varchar NOT NULL, | 19 | r_data varchar NOT NULL, |
20 | r_version varchar NOT NULL, | 20 | r_version varchar NOT NULL, |
21 | r_ctime timestamp NOT NULL DEFAULT current_timestamp, | 21 | r_ctime timestamp NOT NULL DEFAULT current_timestamp, |
22 | r_mtime timestamp NOT NULL DEFAULT current_timestamp, | 22 | r_mtime timestamp NOT NULL DEFAULT current_timestamp, |
23 | r_atime timestamp NOT NULL DEFAULT current_timestamp | 23 | r_atime timestamp NOT NULL DEFAULT current_timestamp |
24 | ); | 24 | ); |
25 | CREATE INDEX therecord_u_id_key ON clipperz.therecord (u_id); | 25 | CREATE INDEX therecord_u_id_key ON clipperz.therecord (u_id); |
26 | 26 | ||
27 | CREATE TABLE clipperz.therecordversion ( | 27 | CREATE TABLE clipperz.therecordversion ( |
28 | rv_id serial PRIMARY KEY, | 28 | rv_id serial PRIMARY KEY, |
29 | r_id integer NOT NULL REFERENCES clipperz.therecord (r_id) ON UPDATE CASCADE ON DELETE CASCADE, | 29 | r_id integer NOT NULL REFERENCES clipperz.therecord (r_id) ON UPDATE CASCADE ON DELETE CASCADE, |
30 | rv_ref varchar NOT NULL UNIQUE, | 30 | rv_ref varchar NOT NULL UNIQUE, |
31 | rv_header varchar, | 31 | rv_header varchar, |
32 | rv_data varchar NOT NULL, | 32 | rv_data varchar NOT NULL, |
@@ -40,28 +40,28 @@ CREATE TABLE clipperz.therecordversion ( | |||
40 | 40 | ||
41 | CREATE TABLE clipperz.otpstatus ( | 41 | CREATE TABLE clipperz.otpstatus ( |
42 | otps_id serial PRIMARY KEY, | 42 | otps_id serial PRIMARY KEY, |
43 | otps_code varchar NOT NULL, | 43 | otps_code varchar NOT NULL, |
44 | otps_name varchar NOT NULL, | 44 | otps_name varchar NOT NULL, |
45 | otps_desc varchar NOT NULL | 45 | otps_desc varchar NOT NULL |
46 | ); | 46 | ); |
47 | 47 | ||
48 | CREATE TABLE clipperz.theotp ( | 48 | CREATE TABLE clipperz.theotp ( |
49 | otp_id serial PRIMARY KEY, | 49 | otp_id serial PRIMARY KEY, |
50 | u_id integer REFERENCES clipperz.theuser (u_id) ON UPDATE CASCADE ON DELETE CASCADE, | 50 | u_id integer REFERENCES clipperz.theuser (u_id) ON UPDATE CASCADE ON DELETE CASCADE, |
51 | otps_id integer REFERENCES clipperz.otpstatus (otps_id) ON UPDATE CASCADE ON DELETE CASCADE, | 51 | otps_id integer REFERENCES clipperz.otpstatus (otps_id) ON UPDATE CASCADE ON DELETE CASCADE, |
52 | otp_ref varchar NOT NULL UNIQUE, | 52 | otp_ref varchar NOT NULL UNIQUE, |
53 | otp_key varchar NOT NULL UNIQUE, | 53 | otp_key varchar NOT NULL UNIQUE, |
54 | otp_key_checksum varchar NOT NULL, | 54 | otp_key_checksum varchar NOT NULL, |
55 | otp_data varchar NOT NULL, | 55 | otp_data varchar NOT NULL, |
56 | otp_version varchar NOT NULL, | 56 | otp_version varchar NOT NULL, |
57 | otp_ctime timestamp NOT NULL DEFAULT current_timestamp, | 57 | otp_ctime timestamp NOT NULL DEFAULT current_timestamp, |
58 | otp_rtime timestamp NOT NULL DEFAULT current_timestamp, | 58 | otp_rtime timestamp NOT NULL DEFAULT current_timestamp, |
59 | otp_utime timestamp NOT NULL DEFAULT current_timestamp | 59 | otp_utime timestamp NOT NULL DEFAULT current_timestamp |
60 | ); | 60 | ); |
61 | 61 | ||
62 | CREATE TABLE clipperz.thesession ( | 62 | CREATE TABLE clipperz.thesession ( |
63 | s_id varchar PRIMARY KEY, | 63 | s_id varchar PRIMARY KEY, |
64 | s_data json, | 64 | s_data varchar, |
65 | s_ctime timestamp DEFAULT current_timestamp, | 65 | s_ctime timestamp DEFAULT current_timestamp, |
66 | s_mtime timestamp DEFAULT current_timestamp | 66 | s_mtime timestamp DEFAULT current_timestamp |
67 | ); | 67 | ); |