|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * WordPress schema for unit tests for the SQLite database integration project. |
| 4 | + * |
| 5 | + * This is hardcoded to SQLite DDL. |
| 6 | + */ |
| 7 | + |
| 8 | +global $blog_tables; |
| 9 | + |
| 10 | +$blog_tables = " |
| 11 | +CREATE TABLE IF NOT EXISTS \"wp_users\"( |
| 12 | + \"ID\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 13 | + \"user_login\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 14 | + \"user_pass\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 15 | + \"user_nicename\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 16 | + \"user_email\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 17 | + \"user_url\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 18 | + \"user_registered\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 19 | + \"user_activation_key\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 20 | + \"user_status\" integer NOT NULL DEFAULT '0', |
| 21 | + \"display_name\" text NOT NULL DEFAULT '' COLLATE NOCASE |
| 22 | +); |
| 23 | +CREATE TABLE IF NOT EXISTS \"wp_usermeta\"( |
| 24 | + \"umeta_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 25 | + \"user_id\" integer NOT NULL DEFAULT '0', |
| 26 | + \"meta_key\" text DEFAULT NULL COLLATE NOCASE, |
| 27 | + \"meta_value\" text COLLATE NOCASE |
| 28 | +); |
| 29 | +CREATE TABLE IF NOT EXISTS \"wp_termmeta\"( |
| 30 | + \"meta_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 31 | + \"term_id\" integer NOT NULL DEFAULT '0', |
| 32 | + \"meta_key\" text DEFAULT NULL COLLATE NOCASE, |
| 33 | + \"meta_value\" text COLLATE NOCASE |
| 34 | +); |
| 35 | +CREATE TABLE IF NOT EXISTS \"wp_terms\"( |
| 36 | + \"term_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 37 | + \"name\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 38 | + \"slug\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 39 | + \"term_group\" integer NOT NULL DEFAULT 0 |
| 40 | +); |
| 41 | +CREATE TABLE IF NOT EXISTS \"wp_term_taxonomy\"( |
| 42 | + \"term_taxonomy_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 43 | + \"term_id\" integer NOT NULL DEFAULT 0, |
| 44 | + \"taxonomy\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 45 | + \"description\" text NOT NULL COLLATE NOCASE, |
| 46 | + \"parent\" integer NOT NULL DEFAULT 0, |
| 47 | + \"count\" integer NOT NULL DEFAULT 0 |
| 48 | +); |
| 49 | +CREATE TABLE IF NOT EXISTS \"wp_term_relationships\"( |
| 50 | + \"object_id\" integer NOT NULL DEFAULT 0, |
| 51 | + \"term_taxonomy_id\" integer NOT NULL DEFAULT 0, |
| 52 | + \"term_order\" integer NOT NULL DEFAULT 0, |
| 53 | + PRIMARY KEY(\"object_id\", \"term_taxonomy_id\") |
| 54 | +); |
| 55 | +CREATE TABLE IF NOT EXISTS \"wp_commentmeta\"( |
| 56 | + \"meta_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 57 | + \"comment_id\" integer NOT NULL DEFAULT '0', |
| 58 | + \"meta_key\" text DEFAULT NULL COLLATE NOCASE, |
| 59 | + \"meta_value\" text COLLATE NOCASE |
| 60 | +); |
| 61 | +CREATE TABLE IF NOT EXISTS \"wp_comments\"( |
| 62 | + \"comment_ID\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 63 | + \"comment_post_ID\" integer NOT NULL DEFAULT '0', |
| 64 | + \"comment_author\" text NOT NULL COLLATE NOCASE, |
| 65 | + \"comment_author_email\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 66 | + \"comment_author_url\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 67 | + \"comment_author_IP\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 68 | + \"comment_date\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 69 | + \"comment_date_gmt\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 70 | + \"comment_content\" text NOT NULL COLLATE NOCASE, |
| 71 | + \"comment_karma\" integer NOT NULL DEFAULT '0', |
| 72 | + \"comment_approved\" text NOT NULL DEFAULT '1' COLLATE NOCASE, |
| 73 | + \"comment_agent\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 74 | + \"comment_type\" text NOT NULL DEFAULT 'comment' COLLATE NOCASE, |
| 75 | + \"comment_parent\" integer NOT NULL DEFAULT '0', |
| 76 | + \"user_id\" integer NOT NULL DEFAULT '0' |
| 77 | +); |
| 78 | +CREATE TABLE IF NOT EXISTS \"wp_links\"( |
| 79 | + \"link_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 80 | + \"link_url\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 81 | + \"link_name\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 82 | + \"link_image\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 83 | + \"link_target\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 84 | + \"link_description\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 85 | + \"link_visible\" text NOT NULL DEFAULT 'Y' COLLATE NOCASE, |
| 86 | + \"link_owner\" integer NOT NULL DEFAULT '1', |
| 87 | + \"link_rating\" integer NOT NULL DEFAULT '0', |
| 88 | + \"link_updated\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 89 | + \"link_rel\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 90 | + \"link_notes\" text NOT NULL COLLATE NOCASE, |
| 91 | + \"link_rss\" text NOT NULL DEFAULT '' COLLATE NOCASE |
| 92 | +); |
| 93 | +CREATE TABLE IF NOT EXISTS \"wp_options\"( |
| 94 | + \"option_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 95 | + \"option_name\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 96 | + \"option_value\" text NOT NULL COLLATE NOCASE, |
| 97 | + \"autoload\" text NOT NULL DEFAULT 'yes' COLLATE NOCASE |
| 98 | +); |
| 99 | +CREATE TABLE IF NOT EXISTS \"wp_postmeta\"( |
| 100 | + \"meta_id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 101 | + \"post_id\" integer NOT NULL DEFAULT '0', |
| 102 | + \"meta_key\" text DEFAULT NULL COLLATE NOCASE, |
| 103 | + \"meta_value\" text COLLATE NOCASE |
| 104 | +); |
| 105 | +CREATE TABLE IF NOT EXISTS \"wp_posts\"( |
| 106 | + \"ID\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 107 | + \"post_author\" integer NOT NULL DEFAULT '0', |
| 108 | + \"post_date\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 109 | + \"post_date_gmt\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 110 | + \"post_content\" text NOT NULL COLLATE NOCASE, |
| 111 | + \"post_title\" text NOT NULL COLLATE NOCASE, |
| 112 | + \"post_excerpt\" text NOT NULL COLLATE NOCASE, |
| 113 | + \"post_status\" text NOT NULL DEFAULT 'publish' COLLATE NOCASE, |
| 114 | + \"comment_status\" text NOT NULL DEFAULT 'open' COLLATE NOCASE, |
| 115 | + \"ping_status\" text NOT NULL DEFAULT 'open' COLLATE NOCASE, |
| 116 | + \"post_password\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 117 | + \"post_name\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 118 | + \"to_ping\" text NOT NULL COLLATE NOCASE, |
| 119 | + \"pinged\" text NOT NULL COLLATE NOCASE, |
| 120 | + \"post_modified\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 121 | + \"post_modified_gmt\" text NOT NULL DEFAULT '0000-00-00 00:00:00' COLLATE NOCASE, |
| 122 | + \"post_content_filtered\" text NOT NULL COLLATE NOCASE, |
| 123 | + \"post_parent\" integer NOT NULL DEFAULT '0', |
| 124 | + \"guid\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 125 | + \"menu_order\" integer NOT NULL DEFAULT '0', |
| 126 | + \"post_type\" text NOT NULL DEFAULT 'post' COLLATE NOCASE, |
| 127 | + \"post_mime_type\" text NOT NULL DEFAULT '' COLLATE NOCASE, |
| 128 | + \"comment_count\" integer NOT NULL DEFAULT '0' |
| 129 | +); |
| 130 | +CREATE INDEX \"wp_users__user_login_key\" ON \"wp_users\"(\"user_login\"); |
| 131 | +CREATE INDEX \"wp_users__user_nicename\" ON \"wp_users\"(\"user_nicename\"); |
| 132 | +CREATE INDEX \"wp_users__user_email\" ON \"wp_users\"(\"user_email\"); |
| 133 | +CREATE INDEX \"wp_usermeta__user_id\" ON \"wp_usermeta\"(\"user_id\"); |
| 134 | +CREATE INDEX \"wp_usermeta__meta_key\" ON \"wp_usermeta\"(\"meta_key\"); |
| 135 | +CREATE INDEX \"wp_termmeta__term_id\" ON \"wp_termmeta\"(\"term_id\"); |
| 136 | +CREATE INDEX \"wp_termmeta__meta_key\" ON \"wp_termmeta\"(\"meta_key\"); |
| 137 | +CREATE INDEX \"wp_terms__slug\" ON \"wp_terms\"(\"slug\"); |
| 138 | +CREATE INDEX \"wp_terms__name\" ON \"wp_terms\"(\"name\"); |
| 139 | +CREATE UNIQUE INDEX \"wp_term_taxonomy__term_id_taxonomy\" ON \"wp_term_taxonomy\"( |
| 140 | + \"term_id\", |
| 141 | + \"taxonomy\" |
| 142 | +); |
| 143 | +CREATE INDEX \"wp_term_taxonomy__taxonomy\" ON \"wp_term_taxonomy\"(\"taxonomy\"); |
| 144 | +CREATE INDEX \"wp_term_relationships__term_taxonomy_id\" ON \"wp_term_relationships\"( |
| 145 | + \"term_taxonomy_id\" |
| 146 | +); |
| 147 | +CREATE INDEX \"wp_commentmeta__comment_id\" ON \"wp_commentmeta\"(\"comment_id\"); |
| 148 | +CREATE INDEX \"wp_commentmeta__meta_key\" ON \"wp_commentmeta\"(\"meta_key\"); |
| 149 | +CREATE INDEX \"wp_comments__comment_post_ID\" ON \"wp_comments\"( |
| 150 | + \"comment_post_ID\" |
| 151 | +); |
| 152 | +CREATE INDEX \"wp_comments__comment_approved_date_gmt\" ON \"wp_comments\"( |
| 153 | + \"comment_approved\", |
| 154 | + \"comment_date_gmt\" |
| 155 | +); |
| 156 | +CREATE INDEX \"wp_comments__comment_date_gmt\" ON \"wp_comments\"( |
| 157 | + \"comment_date_gmt\" |
| 158 | +); |
| 159 | +CREATE INDEX \"wp_comments__comment_parent\" ON \"wp_comments\"(\"comment_parent\"); |
| 160 | +CREATE INDEX \"wp_comments__comment_author_email\" ON \"wp_comments\"( |
| 161 | + \"comment_author_email\" |
| 162 | +); |
| 163 | +CREATE INDEX \"wp_links__link_visible\" ON \"wp_links\"(\"link_visible\"); |
| 164 | +CREATE UNIQUE INDEX \"wp_options__option_name\" ON \"wp_options\"(\"option_name\"); |
| 165 | +CREATE INDEX \"wp_options__autoload\" ON \"wp_options\"(\"autoload\"); |
| 166 | +CREATE INDEX \"wp_postmeta__post_id\" ON \"wp_postmeta\"(\"post_id\"); |
| 167 | +CREATE INDEX \"wp_postmeta__meta_key\" ON \"wp_postmeta\"(\"meta_key\"); |
| 168 | +CREATE INDEX \"wp_posts__post_name\" ON \"wp_posts\"(\"post_name\"); |
| 169 | +CREATE INDEX \"wp_posts__type_status_date\" ON \"wp_posts\"( |
| 170 | + \"post_type\", |
| 171 | + \"post_status\", |
| 172 | + \"post_date\", |
| 173 | + \"ID\" |
| 174 | +); |
| 175 | +CREATE INDEX \"wp_posts__post_parent\" ON \"wp_posts\"(\"post_parent\"); |
| 176 | +CREATE INDEX \"wp_posts__post_author\" ON \"wp_posts\"(\"post_author\"); |
| 177 | +"; |
0 commit comments