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