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