-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sql
79 lines (72 loc) · 1.47 KB
/
init.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
-- Schema
CREATE SEQUENCE uin_seq
MINVALUE 1
START 101
INCREMENT 1
AS INT;
CREATE TABLE gguser (
id SERIAL PRIMARY KEY,
uin INT UNIQUE,
password_gg_ancient BIGINT,
password_gg32 BIGINT,
password_sha1 VARCHAR(40),
name TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
joined TIMESTAMP DEFAULT now()
);
CREATE TABLE adserver_ad (
id SERIAL PRIMARY KEY,
adtype SMALLINT,
bannertype SMALLINT,
image TEXT,
html TEXT
);
CREATE TABLE ggcontact (
id SERIAL PRIMARY KEY,
owner_uin INT NOT NULL,
firstname TEXT,
lastname TEXT,
pseudonym TEXT,
display_name TEXT,
mobile_number TEXT,
grp TEXT,
uin INT,
email TEXT,
avail_sound SMALLINT,
avail_path TEXT,
msg_sound SMALLINT,
msg_path TEXT,
hidden BOOLEAN,
landline_number TEXT,
-- Make sure not to store duplicate contacts
UNIQUE (
owner_uin,
firstname,
lastname,
pseudonym,
display_name,
mobile_number,
grp,
uin,
email,
avail_sound,
avail_path,
msg_sound,
msg_path,
hidden,
landline_number
)
);
-- Initial data
INSERT INTO adserver_ad
(adtype, bannertype, html)
VALUES
(0, 0, 'Hello from poggadaj-HTTP!');
INSERT INTO adserver_ad
(adtype, bannertype, html)
VALUES
(0, 1, 'Hello from poggadaj-HTTP!');
INSERT INTO adserver_ad
(adtype, bannertype, html)
VALUES
(0, 2, 'Hello from poggadaj-HTTP!');