tables.sql 1.46 KB
Newer Older
David Morley's avatar
David Morley committed
1 2 3
CREATE TABLE pods (
 id serial8 UNIQUE PRIMARY KEY,
 domain text UNIQUE NOT NULL,
4
 name text,
David Morley's avatar
David Morley committed
5
 score int DEFAULT 10,
6
 weightedscore int DEFAULT 10,
7 8
 adminrating decimal DEFAULT 10,
 userrating decimal DEFAULT 10,
David Morley's avatar
David Morley committed
9
 whois text,
10
 hidden text DEFAULT 'yes',
11
 ip text,
David Morley's avatar
David Morley committed
12
 ptr text,
13
 country text,
14 15 16 17 18 19
 city text,
 state text, 
 lat text,
 long text,
 connection text,
 postalcode text,
David Morley's avatar
David Morley committed
20
 email text,
21
 ipv6 text,
David Morley's avatar
David Morley committed
22 23 24 25 26 27
 secure text,
 sslvalid text,
 Hgitdate text,
 Hgitref text,
 Hruntime text,
 Hencoding text,
28 29
 pingdomurl text,
 pingdomlast text,
David Morley's avatar
David Morley committed
30
 monthsmonitored int,
root's avatar
root committed
31
 signup int,
32 33 34 35
 total_users int, 
 active_users_halfyear int,
 active_users_monthly int,
 local_posts int,
36
 uptimelast7 numeric(5,2),
David Morley's avatar
David Morley committed
37 38
 status text,
 responsetimelast7 text,
39 40 41 42
 service_facebook booleen,
 service_twitter booleen,
 service_tumblr booleen,
 service_wordpress booleen,
dmorley's avatar
dmorley committed
43 44
 token text,
 tokenexpire timestamp,
45
 comment_counts int,
dmorley's avatar
dmorley committed
46
 weight int DEFAULT 10,
David Morley's avatar
David Morley committed
47 48 49
 dateUpdated timestamp DEFAULT current_timestamp,
 dateLaststats timestamp DEFAULT current_timestamp,
 dateCreated timestamp DEFAULT current_timestamp
David Morley's avatar
David Morley committed
50 51 52 53 54 55 56
);
CREATE TABLE rating_comments (
 id serial8 UNIQUE PRIMARY KEY,
 domain text NOT NULL,
 comment text,
 admin text, 
 pod_id int,
57 58
 rating int,
 username text,
David Morley's avatar
David Morley committed
59 60
 userurl text,
 date timestamp DEFAULT current_timestamp
61 62 63 64 65 66 67 68 69
);
CREATE TABLE users (
 id serial8 UNIQUE PRIMARY KEY,
 admin int NOT NULL,
 username text UNIQUE NOT NULL,
 password text NOT NULL,
 userurl text,
 userpod text,
 dateCreated timestamp DEFAULT current_timestamp
70
);