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