| 1 | -- $Id$ |
|---|
| 2 | |
|---|
| 3 | create table mt_author ( |
|---|
| 4 | author_id integer not null auto_increment primary key, |
|---|
| 5 | author_name varchar(50) not null, |
|---|
| 6 | author_type tinyint not null, |
|---|
| 7 | author_nickname varchar(50), |
|---|
| 8 | author_password varchar(60) not null, |
|---|
| 9 | author_email varchar(75) not null, |
|---|
| 10 | author_url varchar(255), |
|---|
| 11 | author_can_create_blog tinyint, |
|---|
| 12 | author_can_view_log tinyint, |
|---|
| 13 | author_hint varchar(75), |
|---|
| 14 | author_created_by integer, |
|---|
| 15 | author_public_key text, |
|---|
| 16 | author_preferred_language varchar(50), |
|---|
| 17 | author_remote_auth_username varchar(50), |
|---|
| 18 | author_remote_auth_token varchar(50), |
|---|
| 19 | unique (author_name, author_type), |
|---|
| 20 | index (author_email) |
|---|
| 21 | ); |
|---|
| 22 | |
|---|
| 23 | create table mt_blog ( |
|---|
| 24 | blog_id integer not null auto_increment primary key, |
|---|
| 25 | blog_name varchar(255) not null, |
|---|
| 26 | blog_description text, |
|---|
| 27 | blog_site_path varchar(255), |
|---|
| 28 | blog_site_url varchar(255), |
|---|
| 29 | blog_archive_path varchar(255), |
|---|
| 30 | blog_archive_url varchar(255), |
|---|
| 31 | blog_archive_type varchar(255), |
|---|
| 32 | blog_archive_type_preferred varchar(25), |
|---|
| 33 | blog_days_on_index smallint, |
|---|
| 34 | blog_entries_on_index smallint, |
|---|
| 35 | blog_language varchar(5), |
|---|
| 36 | blog_suspicious_url_count integer, |
|---|
| 37 | blog_suspicious_entry_age integer, |
|---|
| 38 | blog_junk_folder_expiry integer, |
|---|
| 39 | blog_junk_score_threshold float, |
|---|
| 40 | blog_file_extension varchar(10), |
|---|
| 41 | blog_email_new_comments tinyint, |
|---|
| 42 | blog_email_new_pings tinyint, |
|---|
| 43 | blog_allow_comment_html tinyint, |
|---|
| 44 | blog_autolink_urls tinyint, |
|---|
| 45 | blog_sort_order_posts varchar(8), |
|---|
| 46 | blog_sort_order_comments varchar(8), |
|---|
| 47 | blog_allow_comments_default tinyint, |
|---|
| 48 | blog_allow_pings_default tinyint, |
|---|
| 49 | blog_server_offset float, |
|---|
| 50 | blog_convert_paras varchar(30), |
|---|
| 51 | blog_convert_paras_comments varchar(30), |
|---|
| 52 | blog_status_default tinyint, |
|---|
| 53 | blog_allow_anon_comments tinyint, |
|---|
| 54 | blog_allow_reg_comments tinyint, |
|---|
| 55 | blog_allow_unreg_comments tinyint, |
|---|
| 56 | blog_allow_pings tinyint, |
|---|
| 57 | blog_moderate_unreg_comments tinyint, |
|---|
| 58 | blog_require_comment_emails tinyint, |
|---|
| 59 | blog_manual_approve_commenters tinyint, |
|---|
| 60 | blog_moderate_pings tinyint, |
|---|
| 61 | blog_words_in_excerpt smallint, |
|---|
| 62 | blog_ping_technorati tinyint, |
|---|
| 63 | blog_ping_weblogs tinyint, |
|---|
| 64 | blog_ping_blogs tinyint, |
|---|
| 65 | blog_ping_others text, |
|---|
| 66 | blog_mt_update_key varchar(30), |
|---|
| 67 | blog_autodiscover_links tinyint, |
|---|
| 68 | blog_welcome_msg text, |
|---|
| 69 | blog_old_style_archive_links tinyint, |
|---|
| 70 | blog_archive_tmpl_monthly varchar(255), |
|---|
| 71 | blog_archive_tmpl_weekly varchar(255), |
|---|
| 72 | blog_archive_tmpl_daily varchar(255), |
|---|
| 73 | blog_archive_tmpl_individual varchar(255), |
|---|
| 74 | blog_archive_tmpl_category varchar(255), |
|---|
| 75 | blog_google_api_key varchar(32), |
|---|
| 76 | blog_sanitize_spec varchar(255), |
|---|
| 77 | blog_cc_license varchar(255), |
|---|
| 78 | blog_is_dynamic tinyint, |
|---|
| 79 | blog_remote_auth_token varchar(50), |
|---|
| 80 | blog_children_modified_on datetime, |
|---|
| 81 | blog_custom_dynamic_templates varchar(25), |
|---|
| 82 | index (blog_name) |
|---|
| 83 | ); |
|---|
| 84 | |
|---|
| 85 | create table mt_category ( |
|---|
| 86 | category_id integer not null auto_increment primary key, |
|---|
| 87 | category_blog_id integer not null, |
|---|
| 88 | category_allow_pings tinyint, |
|---|
| 89 | category_label varchar(100) not null, |
|---|
| 90 | category_description text, |
|---|
| 91 | category_author_id integer, |
|---|
| 92 | category_ping_urls text, |
|---|
| 93 | category_parent integer, |
|---|
| 94 | ); |
|---|
| 95 | |
|---|
| 96 | create table mt_comment ( |
|---|
| 97 | comment_id integer not null auto_increment primary key, |
|---|
| 98 | comment_blog_id integer not null, |
|---|
| 99 | comment_entry_id integer not null, |
|---|
| 100 | comment_ip varchar(16), |
|---|
| 101 | comment_author varchar(100), |
|---|
| 102 | comment_email varchar(75), |
|---|
| 103 | comment_url varchar(255), |
|---|
| 104 | comment_commenter_id integer, |
|---|
| 105 | comment_visible tinyint, |
|---|
| 106 | comment_junk_status tinyint not null default 0, |
|---|
| 107 | comment_junk_log text, |
|---|
| 108 | comment_junk_score float, |
|---|
| 109 | comment_text text, |
|---|
| 110 | comment_last_moved_on timestamp not null, |
|---|
| 111 | comment_created_on datetime not null, |
|---|
| 112 | comment_modified_on timestamp not null, |
|---|
| 113 | comment_created_by integer, |
|---|
| 114 | comment_modified_by integer, |
|---|
| 115 | index (comment_created_on), |
|---|
| 116 | index (comment_entry_id), |
|---|
| 117 | index (comment_blog_id), |
|---|
| 118 | index (comment_junk_status) |
|---|
| 119 | ); |
|---|
| 120 | |
|---|
| 121 | create table mt_entry ( |
|---|
| 122 | entry_id integer not null auto_increment primary key, |
|---|
| 123 | entry_blog_id integer not null, |
|---|
| 124 | entry_status tinyint not null, |
|---|
| 125 | entry_author_id integer not null, |
|---|
| 126 | entry_allow_comments tinyint, |
|---|
| 127 | entry_allow_pings tinyint, |
|---|
| 128 | entry_convert_breaks varchar(30), |
|---|
| 129 | entry_category_id integer, |
|---|
| 130 | entry_title varchar(255), |
|---|
| 131 | entry_excerpt text, |
|---|
| 132 | entry_text text, |
|---|
| 133 | entry_text_more text, |
|---|
| 134 | entry_to_ping_urls text, |
|---|
| 135 | entry_pinged_urls text, |
|---|
| 136 | entry_keywords text, |
|---|
| 137 | entry_tangent_cache text, |
|---|
| 138 | entry_created_on datetime not null, |
|---|
| 139 | entry_modified_on timestamp not null, |
|---|
| 140 | entry_created_by integer, |
|---|
| 141 | entry_modified_by integer, |
|---|
| 142 | entry_basename varchar(50) not null, |
|---|
| 143 | entry_week_number integer, |
|---|
| 144 | index (entry_blog_id), |
|---|
| 145 | index (entry_status), |
|---|
| 146 | index (entry_author_id), |
|---|
| 147 | index (entry_created_on), |
|---|
| 148 | index (entry_basename), |
|---|
| 149 | index (entry_week_number) |
|---|
| 150 | ); |
|---|
| 151 | |
|---|
| 152 | create table mt_ipbanlist ( |
|---|
| 153 | ipbanlist_id integer not null auto_increment primary key, |
|---|
| 154 | ipbanlist_blog_id integer not null, |
|---|
| 155 | ipbanlist_ip varchar(15) not null, |
|---|
| 156 | ipbanlist_created_on datetime not null, |
|---|
| 157 | ipbanlist_modified_on timestamp not null, |
|---|
| 158 | ipbanlist_created_by integer, |
|---|
| 159 | ipbanlist_modified_by integer, |
|---|
| 160 | index (ipbanlist_blog_id), |
|---|
| 161 | index (ipbanlist_ip) |
|---|
| 162 | ); |
|---|
| 163 | |
|---|
| 164 | create table mt_log ( |
|---|
| 165 | log_id integer not null auto_increment primary key, |
|---|
| 166 | log_message varchar(255), |
|---|
| 167 | log_ip varchar(16), |
|---|
| 168 | log_blog_id integer default 0 not null, |
|---|
| 169 | log_created_on datetime not null, |
|---|
| 170 | log_modified_on timestamp not null, |
|---|
| 171 | log_created_by integer, |
|---|
| 172 | log_modified_by integer, |
|---|
| 173 | index (log_created_on) |
|---|
| 174 | ); |
|---|
| 175 | |
|---|
| 176 | create table mt_notification ( |
|---|
| 177 | notification_id integer not null auto_increment primary key, |
|---|
| 178 | notification_blog_id integer not null, |
|---|
| 179 | notification_name varchar(50), |
|---|
| 180 | notification_email varchar(75), |
|---|
| 181 | notification_url varchar(255), |
|---|
| 182 | notification_created_on datetime not null, |
|---|
| 183 | notification_modified_on timestamp not null, |
|---|
| 184 | notification_created_by integer, |
|---|
| 185 | notification_modified_by integer, |
|---|
| 186 | index (notification_blog_id) |
|---|
| 187 | ); |
|---|
| 188 | |
|---|
| 189 | create table mt_permission ( |
|---|
| 190 | permission_id integer not null auto_increment primary key, |
|---|
| 191 | permission_author_id integer not null, |
|---|
| 192 | permission_blog_id integer not null, |
|---|
| 193 | permission_role_mask smallint, |
|---|
| 194 | permission_entry_prefs varchar(255), |
|---|
| 195 | unique (permission_blog_id, permission_author_id) |
|---|
| 196 | ); |
|---|
| 197 | |
|---|
| 198 | create table mt_placement ( |
|---|
| 199 | placement_id integer not null auto_increment primary key, |
|---|
| 200 | placement_entry_id integer not null, |
|---|
| 201 | placement_blog_id integer not null, |
|---|
| 202 | placement_category_id integer not null, |
|---|
| 203 | placement_is_primary tinyint not null, |
|---|
| 204 | index (placement_entry_id), |
|---|
| 205 | index (placement_category_id), |
|---|
| 206 | index (placement_is_primary) |
|---|
| 207 | ); |
|---|
| 208 | |
|---|
| 209 | create table mt_plugindata ( |
|---|
| 210 | plugindata_id integer not null auto_increment primary key, |
|---|
| 211 | plugindata_plugin varchar(50) not null, |
|---|
| 212 | plugindata_key varchar(255) not null, |
|---|
| 213 | plugindata_data mediumtext, |
|---|
| 214 | index (plugindata_plugin), |
|---|
| 215 | index (plugindata_key) |
|---|
| 216 | ); |
|---|
| 217 | |
|---|
| 218 | create table mt_template ( |
|---|
| 219 | template_id integer not null auto_increment primary key, |
|---|
| 220 | template_blog_id integer not null, |
|---|
| 221 | template_name varchar(50) not null, |
|---|
| 222 | template_type varchar(25) not null, |
|---|
| 223 | template_outfile varchar(255), |
|---|
| 224 | template_rebuild_me tinyint default 1, |
|---|
| 225 | template_text text, |
|---|
| 226 | template_linked_file varchar(255), |
|---|
| 227 | template_linked_file_mtime varchar(10), |
|---|
| 228 | template_linked_file_size mediumint, |
|---|
| 229 | template_created_on datetime not null, |
|---|
| 230 | template_modified_on timestamp not null, |
|---|
| 231 | template_created_by integer, |
|---|
| 232 | template_modified_by integer, |
|---|
| 233 | template_build_dynamic tinyint, |
|---|
| 234 | unique (template_blog_id, template_name), |
|---|
| 235 | index (template_type) |
|---|
| 236 | ); |
|---|
| 237 | |
|---|
| 238 | create table mt_templatemap ( |
|---|
| 239 | templatemap_id integer not null auto_increment primary key, |
|---|
| 240 | templatemap_blog_id integer not null, |
|---|
| 241 | templatemap_template_id integer not null, |
|---|
| 242 | templatemap_archive_type varchar(25) not null, |
|---|
| 243 | templatemap_file_template varchar(255), |
|---|
| 244 | templatemap_is_preferred tinyint not null, |
|---|
| 245 | index (templatemap_blog_id), |
|---|
| 246 | index (templatemap_template_id), |
|---|
| 247 | index (templatemap_archive_type), |
|---|
| 248 | index (templatemap_is_preferred) |
|---|
| 249 | ); |
|---|
| 250 | |
|---|
| 251 | create table mt_trackback ( |
|---|
| 252 | trackback_id integer not null auto_increment primary key, |
|---|
| 253 | trackback_blog_id integer not null, |
|---|
| 254 | trackback_title varchar(255), |
|---|
| 255 | trackback_description text, |
|---|
| 256 | trackback_rss_file varchar(255), |
|---|
| 257 | trackback_url varchar(255), |
|---|
| 258 | trackback_entry_id integer not null, |
|---|
| 259 | trackback_category_id integer not null, |
|---|
| 260 | trackback_passphrase varchar(30), |
|---|
| 261 | trackback_is_disabled tinyint default 0, |
|---|
| 262 | trackback_created_on datetime not null, |
|---|
| 263 | trackback_modified_on timestamp not null, |
|---|
| 264 | trackback_created_by integer, |
|---|
| 265 | trackback_modified_by integer, |
|---|
| 266 | index (trackback_blog_id), |
|---|
| 267 | index (trackback_entry_id), |
|---|
| 268 | index (trackback_category_id), |
|---|
| 269 | index (trackback_created_on) |
|---|
| 270 | ); |
|---|
| 271 | |
|---|
| 272 | create table mt_tbping ( |
|---|
| 273 | tbping_id integer not null auto_increment primary key, |
|---|
| 274 | tbping_blog_id integer not null, |
|---|
| 275 | tbping_tb_id integer not null, |
|---|
| 276 | tbping_title varchar(255), |
|---|
| 277 | tbping_excerpt text, |
|---|
| 278 | tbping_source_url varchar(255), |
|---|
| 279 | tbping_ip varchar(15) not null, |
|---|
| 280 | tbping_blog_name varchar(255), |
|---|
| 281 | tbping_visible tinyint, |
|---|
| 282 | tbping_junk_log text, |
|---|
| 283 | tbping_junk_status tinyint not null default 0, |
|---|
| 284 | tbping_junk_score float, |
|---|
| 285 | tbping_last_moved_on timestamp not null, |
|---|
| 286 | tbping_created_on datetime not null, |
|---|
| 287 | tbping_modified_on timestamp not null, |
|---|
| 288 | tbping_created_by integer, |
|---|
| 289 | tbping_modified_by integer, |
|---|
| 290 | index (tbping_blog_id), |
|---|
| 291 | index (tbping_tb_id), |
|---|
| 292 | index (tbping_ip), |
|---|
| 293 | index (tbping_junk_status), |
|---|
| 294 | index (tbping_created_on), |
|---|
| 295 | index (tbping_last_moved_on) |
|---|
| 296 | ); |
|---|
| 297 | |
|---|
| 298 | create table mt_session ( |
|---|
| 299 | session_id varchar(80) not null primary key, |
|---|
| 300 | session_data text, |
|---|
| 301 | session_email varchar(255), |
|---|
| 302 | session_name varchar(255), |
|---|
| 303 | session_start int not null, |
|---|
| 304 | session_kind varchar(2), |
|---|
| 305 | index (session_start) |
|---|
| 306 | ); |
|---|
| 307 | |
|---|
| 308 | create table mt_fileinfo ( |
|---|
| 309 | fileinfo_id integer primary key auto_increment, |
|---|
| 310 | fileinfo_blog_id integer not null, |
|---|
| 311 | fileinfo_entry_id integer, |
|---|
| 312 | fileinfo_url varchar(255), |
|---|
| 313 | fileinfo_file_path text, |
|---|
| 314 | fileinfo_template_id integer, |
|---|
| 315 | fileinfo_templatemap_id integer, |
|---|
| 316 | fileinfo_archive_type varchar(255), |
|---|
| 317 | fileinfo_category_id integer, |
|---|
| 318 | fileinfo_startdate varchar(80), |
|---|
| 319 | fileinfo_virtual tinyint, |
|---|
| 320 | index(fileinfo_blog_id), |
|---|
| 321 | index(fileinfo_entry_id), |
|---|
| 322 | index(fileinfo_url) |
|---|
| 323 | ); |
|---|