forked from mad5/ownstagram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDATABASE.sql
72 lines (65 loc) · 2.15 KB
/
DATABASE.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
CREATE TABLE IF NOT EXISTS ost_comments (
co_pk bigint(20) NOT NULL AUTO_INCREMENT,
co_i_fk bigint(20) NOT NULL,
co_u_fk bigint(20) NOT NULL,
co_date datetime NOT NULL,
co_comment varchar(1000) NOT NULL,
PRIMARY KEY (co_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS ost_follow (
f_pk bigint(20) NOT NULL AUTO_INCREMENT,
f_me_u_fk bigint(20) NOT NULL,
f_follow_u_fk int(11) NOT NULL,
f_date datetime NOT NULL,
f_confirmed datetime NOT NULL,
PRIMARY KEY (f_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS ost_groups (
g_pk bigint(20) NOT NULL AUTO_INCREMENT,
g_name varchar(50) NOT NULL,
g_u_fk bigint(20) NOT NULL,
PRIMARY KEY (g_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS ost_images (
i_pk bigint(20) NOT NULL AUTO_INCREMENT,
i_u_fk bigint(20) NOT NULL,
i_key varchar(50) NOT NULL,
i_date datetime NOT NULL,
i_file varchar(255) NOT NULL,
i_public tinyint(4) NOT NULL,
i_title varchar(255) NOT NULL,
i_g_fk bigint(20) NOT NULL,
i_lat double NOT NULL,
i_lng double NOT NULL,
i_location varchar(255) NOT NULL,
i_star tinyint(4) NOT NULL,
PRIMARY KEY (i_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS ost_settings (
s_pk bigint(20) NOT NULL AUTO_INCREMENT,
s_subtitle varchar(255) NOT NULL,
s_allowregistration tinyint(4) NOT NULL,
s_allowfriendsstreams tinyint(4) NOT NULL,
s_welcometext text NOT NULL,
s_title varchar(50) NOT NULL,
PRIMARY KEY (s_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS ost_user (
u_pk bigint(20) NOT NULL AUTO_INCREMENT,
u_email varchar(255) NOT NULL,
u_password varchar(255) NOT NULL,
u_registered datetime NOT NULL,
u_confirmed datetime NOT NULL,
u_nickname varchar(255) NOT NULL,
u_country varchar(255) NOT NULL,
u_city varchar(255) NOT NULL,
PRIMARY KEY (u_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS ost_views (
v_pk bigint(20) NOT NULL AUTO_INCREMENT,
v_u_fk bigint(20) NOT NULL,
v_i_fk bigint(20) NOT NULL,
v_date datetime NOT NULL,
PRIMARY KEY (v_pk),
KEY v_u_fk (v_u_fk,v_i_fk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;