-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasagi-schema-main.sql
134 lines (130 loc) · 5.19 KB
/
asagi-schema-main.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
CREATE TABLE `po` (
`doc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`media_id` int(10) unsigned NOT NULL DEFAULT 0,
`poster_ip` decimal(39,0) unsigned NOT NULL DEFAULT 0,
`num` int(10) unsigned NOT NULL,
`subnum` int(10) unsigned NOT NULL,
`thread_num` int(10) unsigned NOT NULL DEFAULT 0,
`op` tinyint(1) NOT NULL DEFAULT 0,
`timestamp` int(10) unsigned NOT NULL,
`timestamp_expired` int(10) unsigned NOT NULL,
`preview_orig` varchar(20) DEFAULT NULL,
`preview_w` smallint(5) unsigned NOT NULL DEFAULT 0,
`preview_h` smallint(5) unsigned NOT NULL DEFAULT 0,
`media_filename` text DEFAULT NULL,
`media_w` smallint(5) unsigned NOT NULL DEFAULT 0,
`media_h` smallint(5) unsigned NOT NULL DEFAULT 0,
`media_size` int(10) unsigned NOT NULL DEFAULT 0,
`media_hash` varchar(25) DEFAULT NULL,
`media_orig` varchar(25) DEFAULT NULL,
`spoiler` tinyint(1) NOT NULL DEFAULT 0,
`deleted` tinyint(1) NOT NULL DEFAULT 0,
`capcode` varchar(1) NOT NULL DEFAULT 'N',
`email` varchar(100) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`trip` varchar(25) DEFAULT NULL,
`title` varchar(100) DEFAULT NULL,
`comment` text DEFAULT NULL,
`delpass` tinytext DEFAULT NULL,
`sticky` tinyint(1) NOT NULL DEFAULT 0,
`locked` tinyint(1) NOT NULL DEFAULT 0,
`poster_hash` varchar(8) DEFAULT NULL,
`poster_country` varchar(2) DEFAULT NULL,
`exif` text DEFAULT NULL,
PRIMARY KEY (`doc_id`),
UNIQUE KEY `num_subnum_index` (`num`,`subnum`),
KEY `thread_num_subnum_index` (`thread_num`,`num`,`subnum`),
KEY `subnum_index` (`subnum`),
KEY `op_index` (`op`),
KEY `media_id_index` (`media_id`),
KEY `media_hash_index` (`media_hash`),
KEY `media_orig_index` (`media_orig`),
KEY `name_trip_index` (`name`,`trip`),
KEY `trip_index` (`trip`),
KEY `email_index` (`email`),
KEY `poster_ip_index` (`poster_ip`),
KEY `timestamp_index` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `po_deleted` (
`doc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`media_id` int(10) unsigned NOT NULL DEFAULT 0,
`poster_ip` decimal(39,0) unsigned NOT NULL DEFAULT 0,
`num` int(10) unsigned NOT NULL,
`subnum` int(10) unsigned NOT NULL,
`thread_num` int(10) unsigned NOT NULL DEFAULT 0,
`op` tinyint(1) NOT NULL DEFAULT 0,
`timestamp` int(10) unsigned NOT NULL,
`timestamp_expired` int(10) unsigned NOT NULL,
`preview_orig` varchar(20) DEFAULT NULL,
`preview_w` smallint(5) unsigned NOT NULL DEFAULT 0,
`preview_h` smallint(5) unsigned NOT NULL DEFAULT 0,
`media_filename` text DEFAULT NULL,
`media_w` smallint(5) unsigned NOT NULL DEFAULT 0,
`media_h` smallint(5) unsigned NOT NULL DEFAULT 0,
`media_size` int(10) unsigned NOT NULL DEFAULT 0,
`media_hash` varchar(25) DEFAULT NULL,
`media_orig` varchar(25) DEFAULT NULL,
`spoiler` tinyint(1) NOT NULL DEFAULT 0,
`deleted` tinyint(1) NOT NULL DEFAULT 0,
`capcode` varchar(1) NOT NULL DEFAULT 'N',
`email` varchar(100) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`trip` varchar(25) DEFAULT NULL,
`title` varchar(100) DEFAULT NULL,
`comment` text DEFAULT NULL,
`delpass` tinytext DEFAULT NULL,
`sticky` tinyint(1) NOT NULL DEFAULT 0,
`locked` tinyint(1) NOT NULL DEFAULT 0,
`poster_hash` varchar(8) DEFAULT NULL,
`poster_country` varchar(2) DEFAULT NULL,
`exif` text DEFAULT NULL,
PRIMARY KEY (`doc_id`),
UNIQUE KEY `num_subnum_index` (`num`,`subnum`),
KEY `thread_num_subnum_index` (`thread_num`,`num`,`subnum`),
KEY `subnum_index` (`subnum`),
KEY `op_index` (`op`),
KEY `media_id_index` (`media_id`),
KEY `media_hash_index` (`media_hash`),
KEY `media_orig_index` (`media_orig`),
KEY `name_trip_index` (`name`,`trip`),
KEY `trip_index` (`trip`),
KEY `email_index` (`email`),
KEY `poster_ip_index` (`poster_ip`),
KEY `timestamp_index` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `po_images` (
`media_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`media_hash` varchar(25) NOT NULL,
`media` varchar(20) DEFAULT NULL,
`preview_op` varchar(20) DEFAULT NULL,
`preview_reply` varchar(20) DEFAULT NULL,
`total` int(10) unsigned NOT NULL DEFAULT 0,
`banned` smallint(5) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`media_id`),
UNIQUE KEY `media_hash_index` (`media_hash`),
KEY `total_index` (`total`),
KEY `banned_index` (`banned`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `po_threads` (
`thread_num` int(10) unsigned NOT NULL,
`time_op` int(10) unsigned NOT NULL,
`time_last` int(10) unsigned NOT NULL,
`time_bump` int(10) unsigned NOT NULL,
`time_ghost` int(10) unsigned DEFAULT NULL,
`time_ghost_bump` int(10) unsigned DEFAULT NULL,
`time_last_modified` int(10) unsigned NOT NULL,
`nreplies` int(10) unsigned NOT NULL DEFAULT 0,
`nimages` int(10) unsigned NOT NULL DEFAULT 0,
`sticky` tinyint(1) NOT NULL DEFAULT 0,
`locked` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`thread_num`),
KEY `time_op_index` (`time_op`),
KEY `time_bump_index` (`time_bump`),
KEY `time_ghost_bump_index` (`time_ghost_bump`),
KEY `time_last_modified_index` (`time_last_modified`),
KEY `sticky_index` (`sticky`),
KEY `locked_index` (`locked`),
KEY `sticky_time_bump_index` (`sticky`,`time_bump`),
KEY `sticky_time_ghost_bump_index` (`sticky`,`time_ghost_bump`),
KEY `sticky_thread_num_index` (`sticky`,`thread_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;