|
|
18行目: |
18行目: |
| 下図は、WordPress データベースの概要および標準インストール時に作成されるテーブル間の関係を視覚的に表したものです。また、[[#Table Overview|テーブル一覧]]以降では、テーブルおよびカラムの詳細を掲載しています。 | | 下図は、WordPress データベースの概要および標準インストール時に作成されるテーブル間の関係を視覚的に表したものです。また、[[#Table Overview|テーブル一覧]]以降では、テーブルおよびカラムの詳細を掲載しています。 |
| | | |
− | [[Image:WP3.0-ERD.png|500px|WP3.0 データベース関連図(ER図)]] /[[:en:Image:WP3.0-ERD.png|英語版で画像を見る]] | + | [[Image:WP3.2.1-ERD.png|500px|WP3.0 データベース関連図(ER図)]] /[[:en:Image:WP3.0-ERD.png|英語版で画像を見る]] |
| | | |
| 標準インストールでテーブル間の整合性は強制されない事に注意してください(例: 投稿とコメント)。もし WordPress データベースを操作するプラグインやその他の拡張機能を作成する場合は、ハウスキーピング処理をコードに含め、孤立したレコードがテーブルに残らないようにしましょう。この一例として、外部キーが削除された場合、一連の SQL コマンドを使って他のテーブルのレコードを削除するといったことが挙げられます。また、このような操作を行う前には、ユーザーにバックアップを取るよう促すことも忘れないでください。 | | 標準インストールでテーブル間の整合性は強制されない事に注意してください(例: 投稿とコメント)。もし WordPress データベースを操作するプラグインやその他の拡張機能を作成する場合は、ハウスキーピング処理をコードに含め、孤立したレコードがテーブルに残らないようにしましょう。この一例として、外部キーが削除された場合、一連の SQL コマンドを使って他のテーブルのレコードを削除するといったことが挙げられます。また、このような操作を行う前には、ユーザーにバックアップを取るよう促すことも忘れないでください。 |
| | | |
| <div id="Table_Overview"> | | <div id="Table_Overview"> |
| + | |
| == テーブル一覧 == | | == テーブル一覧 == |
| </div> | | </div> |
2011年9月1日 (木) 13:41時点における版
ページ名検討中: このページ名「データベース構造」について改名が提案されています。ご意見をお寄せください。(2008-11-14)
以下は、WordPress バージョン 3.0 の標準的なインストールで作成されるデータベース・テーブルの概要と説明です。現在、WordPress バージョン 3.0 が対応しているデータベースは、MySQL バージョン 4.1.2 以上のみです。
WordPressは内部でデータベースと連動しているため、エンドユーザはその構造を気にかける必要はありません。しかしプラグインを作成していると、WordPressが格納するデータやその関係について知りたいと思うかもしれません。If you have already attempted to use the existing WordPress API to access the data you need but have determined it's not possible without accessing the database directly, WordPressではこの処理が簡単にできるよう wpdb クラスを用意しています。
注:
- テーブル名の接頭辞(
wp_
)は、WordPress インストール時の設定によります。
- プラグインやテーマによって、設定データの追加、既存テーブルへのフィールド追加、新規テーブル作成がされることもあります。
- 旧バージョンのデータベース概要
データベース関連図
下図は、WordPress データベースの概要および標準インストール時に作成されるテーブル間の関係を視覚的に表したものです。また、テーブル一覧以降では、テーブルおよびカラムの詳細を掲載しています。
/英語版で画像を見る
標準インストールでテーブル間の整合性は強制されない事に注意してください(例: 投稿とコメント)。もし WordPress データベースを操作するプラグインやその他の拡張機能を作成する場合は、ハウスキーピング処理をコードに含め、孤立したレコードがテーブルに残らないようにしましょう。この一例として、外部キーが削除された場合、一連の SQL コマンドを使って他のテーブルのレコードを削除するといったことが挙げられます。また、このような操作を行う前には、ユーザーにバックアップを取るよう促すことも忘れないでください。
テーブル一覧
WordPress の標準インストールで作成される全テーブルの一覧です。各テーブルが持つ具体的な情報は次節をご覧ください。
WordPress 3.0 テーブル (11)
|
テーブル名 |
説明 |
関連インタフェース画面
|
wp_commentmeta
|
Each comment features information called the meta data and it is stored in the wp_commentmeta. |
Typically plugins would be add their own information to this table.
|
wp_comments
|
WordPress へのコメント・トラックバック・ピンバックデータを格納 |
コメントは投稿記事への反応として読者によって作成される。管理者によるコメント管理は 管理パネル > コメント > コメントにて
|
wp_links
|
リンク作成機能で入力されたリンク情報を格納 |
|
wp_options
|
管理 > 設定パネルで設定されたオプション設定情報を格納(オプション設定リファレンス参照)。プラグインの設定情報が格納されることも多い。
|
|
wp_postmeta
|
メタデータという各投稿記事特有の情報を格納。カスタムフィールドとして使用するほか、各投稿に情報や設定を付加するようなプラグインが、その情報を当テーブルに追加することがある。 |
(カスタムフィールド)
|
wp_posts
|
WordPress データの核である投稿記事のほか、ページ、ナビゲーションメニューのデータを格納 |
|
wp_terms
|
投稿およびリンクの分類(カテゴリ・タグ)に使われる語句の基本情報を格納 |
|
wp_term_relationships
|
オブジェクト(wp_posts テーブルの各投稿記事、wp_links テーブル内の各リンク)と wp_term_taxonomy の(少なくとも 1)カテゴリ・タグとの関連付け情報を格納
|
wp_term_taxonomy
|
投稿およびリンクの分類上の語句(カテゴリ・タグ)データを格納
|
wp_usermeta
|
各ユーザ特有のユーザ・メタデータを格納 |
|
wp_users
|
登録ユーザ情報を格納 |
|
テーブル詳細
WordPress の標準インストールで作成される各テーブルの項目一覧です。
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
meta_id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment |
コメントメタID(登録順に自動採番)
|
comment_id |
bigint(20) unsigned |
|
IND |
0 |
FK->wp_comments.comment_id |
コメントID
|
meta_key |
varchar(255) |
YES |
IND |
NULL |
|
meta_value |
longtext |
YES |
|
NULL |
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
0 |
meta_ID
|
comment_id |
INDEX |
none |
comment_id
|
meta_key |
INDEX |
none |
meta_key
|
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
comment_ID |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment |
コメントID(投稿順に自動採番)
|
comment_post_ID |
bigint(20) unsigned |
|
IND |
0 |
FK->wp_posts.ID |
コメントが属する投稿ID
|
comment_author |
tinytext |
|
|
|
|
コメント投稿者
|
comment_author_email |
varchar(100) |
|
|
|
|
コメント投稿者の Eメールアドレス
|
comment_author_url |
varchar(200) |
|
|
|
|
コメント投稿者のウェブサイトURL
|
comment_author_IP |
varchar(100) |
|
|
|
|
コメント投稿者の IPアドレス
|
comment_date |
datetime |
|
|
0000-00-00 00:00:00 |
|
コメント投稿日時
|
comment_date_gmt |
datetime |
|
IND & IND Pt2 |
0000-00-00 00:00:00 |
|
コメント投稿日時(GMT)
|
comment_content |
text |
|
|
|
|
コメント内容
|
comment_karma |
int(11) |
|
|
0 |
|
|
comment_approved |
varchar(20) |
|
IND & Ind Pt1 |
1 |
|
コメントの承認状態
-
'0' : 承認待ち
-
'1' : 承認済み
-
'spam' : スパム
|
comment_agent |
varchar(255) |
|
|
|
|
コメント投稿者のユーザエージェント
|
comment_type |
varchar(20) |
|
|
|
|
コメントの種類
-
'trackback' : トラックバック
-
'pingback' : ピンバック
- 通常コメントは値なし
|
comment_parent |
bigint(20) unsigned |
|
|
0 |
FK->wp_comments.ID
|
user_id |
bigint(20) unsigned |
|
|
0 |
FK->wp_users.ID |
コメント投稿者が登録ユーザであるとき、そのユーザID
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
1 |
comment_ID
|
comment_approved |
INDEX |
None |
comment_approved
|
comment_post_ID |
INDEX |
None |
comment_post_ID
|
comment_approved_date_gmt |
INDEX |
None |
comment_approved comment_date_gmt
|
comment_date_gmt |
INDEX |
None |
comment_date_gmt
|
comment_parent |
INDEX |
None |
comment_parent
|
テーブル: wp_links
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
link_id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment |
リンクID(登録順に自動採番)
|
link_url |
varchar(255) |
|
|
|
|
リンク URL
|
link_name |
varchar(255) |
|
|
|
|
リンク名
|
link_image |
varchar(255) |
|
|
|
|
リンク画像の URI
|
link_target |
varchar(25) |
|
|
|
|
リンクターゲット
|
link_description |
varchar(255) |
|
|
|
|
説明
|
link_visible |
varchar(20) |
|
IND |
Y |
|
|
link_owner |
bigint(20) unsigned |
|
|
1 |
|
link_rating |
int(11) |
|
|
0 |
|
評価
|
link_updated |
datetime |
|
|
0000-00-00 00:00:00 |
|
link_rel |
varchar(255) |
|
|
|
|
link_notes |
mediumtext |
|
|
|
|
メモ
|
link_rss |
varchar(255) |
|
|
|
|
リンクのフィード URI
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
7 |
link_ID
|
link_category |
INDEX |
None |
link_category
|
link_visible |
INDEX |
None |
link_visible
|
テーブル: wp_options
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
option_id |
bigint(20) unsigned |
|
PRI Pt1 |
NULL |
auto_increment |
オプションID(登録順に自動採番)
|
blog_id |
int(11) |
|
PRI Pt2 |
0 |
|
option_name |
varchar(64) |
|
PRI Pt3 & IND |
|
|
オプション名(オプション設定リファレンス参照)
|
option_value |
longtext |
|
|
|
|
オプション値
|
autoload |
varchar(20) |
|
|
yes |
|
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
184 |
option_id blog_id option_name
|
option_name |
UNIQUE |
184 |
option_name
|
テーブル: wp_postmeta
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
meta_id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment |
メタID(一意)(登録順に自動採番)
|
post_id |
bigint(20) unsigned |
|
IND |
0 |
FK->wp_posts.ID |
投稿ID
|
meta_key |
varchar(255) |
YES |
IND |
NULL |
|
カスタムフィールドのキー名
|
meta_value |
longtext |
YES |
|
NULL |
|
カスタムフィールドの値
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
13 |
meta_ID
|
post_id |
INDEX |
15 |
post_id
|
meta_key |
INDEX |
7 |
meta_key
|
テーブル: wp_posts
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
ID |
bigint(20) unsigned |
|
PRI & IND Pt4 |
|
auto_increment |
投稿ID(保存順に自動採番)
|
post_author |
bigint(20) unsigned |
|
|
0 |
FK->wp_users.ID |
投稿者のユーザID
|
post_date |
datetime |
|
IND Pt3 |
0000-00-00 00:00:00 |
|
投稿日時
|
post_date_gmt |
datetime |
|
|
0000-00-00 00:00:00 |
|
投稿日時(GMT)
|
post_content |
longtext |
|
|
|
|
本文
|
post_title |
text |
|
|
|
|
タイトル
|
post_excerpt |
text |
|
|
|
|
抜粋オプション
|
post_status |
varchar(20) |
|
IND PT2 |
publish |
|
投稿ステータス
-
'publish' : 公開済み
-
'pending' : ペンディング
-
'draft' : 草稿
-
'private' : プライベート(非公開)
-
'static' :(2.0.x 以前はページ)
-
'object' :
-
'attachment' :
-
'inherit' : 継承(添付ファイル、改訂履歴・自動保存のとき)
-
'future' : 予約投稿
|
comment_status |
varchar(20) |
|
|
open |
|
コメントステータス
-
'open' : 許可
-
'closed' : 不許可
-
'registered_only' : 登録ユーザのみ
|
ping_status |
varchar(20) |
|
|
open |
|
ピン・ステータス
-
'open' : トラックバック・ピンバックを受け付ける
-
'closed' : 受け付けない
|
post_password |
varchar(20) |
|
|
|
|
閲覧パスワード
|
post_name |
varchar(200) |
|
IND |
|
|
- 投稿スラッグ
-
'{親ID}-revision(-#)' (改訂履歴のとき)
-
'{親ID}-autosave' (自動保存のとき)
|
to_ping |
text |
|
|
|
|
pinged |
text |
|
|
|
|
ピン通知済み URL
|
post_modified |
datetime |
|
|
0000-00-00 00:00:00 |
|
更新日時
|
post_modified_gmt |
datetime |
|
|
0000-00-00 00:00:00 |
|
更新日時(GMT)
|
post_content_filtered |
text |
|
|
|
|
|
post_parent |
bigint(20) unsigned |
|
|
0 |
FK->wp_posts.ID |
親ID
- 親ページの投稿ID
- 添付ファイルが属する投稿ID
- 改訂履歴・自動保存のベース投稿ID
|
guid |
varchar(255) |
|
|
|
|
menu_order |
int(11) |
|
|
0 |
|
ページの表示順
|
post_type |
varchar(20) |
|
IND Pt1 |
post |
|
投稿種別
-
'post' : 投稿
-
'page' : ページ
-
'attachment' : 添付ファイル
-
'revision' : 改訂履歴・自動保存
|
post_mime_type |
varchar(100) |
|
|
|
|
添付ファイルのとき MIMEタイプ(image/png など)
|
comment_count |
bigint(20) |
|
|
0 |
|
コメント数
|
インデックス
キー名 |
種別 |
Cardinality |
フィールド
|
PRIMARY |
PRIMARY |
2 |
ID
|
post_name |
INDEX |
None |
post_name
|
type_status_date |
INDEX |
None |
post_type post_status post_date ID
|
post_parent |
INDEX |
None |
post_parent
|
post_author |
INDEX |
None |
post_author
|
テーブル: wp_terms
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
term_id |
bigint(20) unsigned |
|
PRI |
|
auto_increment |
term のユニークID
|
name |
varchar(200) |
|
|
|
|
term 名
|
slug |
varchar(200) |
|
UNI |
|
|
term スラッグ。term 名を URL で扱いやすい形にしたもの
|
term_group |
bigint(10) |
|
|
0 |
|
類義語のグルーピング
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
2 |
term_ID
|
slug |
UNIQUE |
2 |
slug
|
name |
Index |
none |
name
|
テーブル: wp_term_relationships
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
object_id |
bigint(20) unsigned |
|
PRI Pt1 |
0 |
|
記事ID or リンクID
|
term_taxonomy_id |
bigint(20) unsigned |
|
PRI Pt2 & IND |
0 |
FK->wp_term_taxonomy.term_taxonomy_id |
term_taxonomy テーブルの term_taxonomy_id
|
term_order |
int(11) |
|
|
0 |
|
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
8 |
object_id term_taxonomy_id
|
term_taxonomy_id |
INDEX |
None |
term_taxonomy_id
|
テーブル: wp_term_taxonomy
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
term_taxonomy_id |
bigint(20) unsigned |
|
PRI |
|
auto_increment |
term+taxonomy ペアのユニークID
|
term_id |
bigint(20) unsigned |
|
UNI Pt1 |
0 |
FK->wp_terms.term_id |
wp_terms テーブルの term_id
|
taxonomy |
varchar(32) |
|
UNI Pt2 |
|
|
term が属する taxonomy
-
'category' : 記事カテゴリ
-
'link_category' : リンクカテゴリ
-
'post_tag' : タグ
|
description |
longtext |
|
|
|
|
term の分類上の説明。「カテゴリ説明」など
|
parent |
bigint(20) unsigned |
|
|
0 |
|
分類上の term 間の上下関係
|
count |
bigint(20) |
|
|
0 |
|
term+taxonomy ペアに関連付けられたオブジェクト数。taxonomy='category' であればこのカテゴリに属する投稿記事数
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
2 |
term_taxonomy_id
|
term_id_taxonomy |
UNIQUE |
2 |
term_id taxonomy
|
taxonomy |
INDEX |
None |
taxonomy
|
テーブル: wp_usermeta
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
umeta_id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment |
ユーザ・メタデータの ID(登録順に自動採番)
|
user_id |
bigint(20) unsigned |
|
IND |
'0' |
FK->wp_users.ID |
wp_users テーブルのユーザID
|
meta_key |
varchar(255) |
YES |
IND |
NULL |
|
ユーザ・メタデータのキー名(wp_capabilities など)
|
meta_value |
longtext |
YES |
|
NULL |
|
値
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
9 |
umeta_id
|
user_id |
INDEX |
None |
user_id
|
meta_key |
INDEX |
None |
meta_key
|
テーブル: wp_users
フィールド |
種別 |
Null |
キー |
初期値 |
備考 |
説明
|
ID |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment |
ユーザID
|
user_login |
varchar(60) |
|
IND |
|
|
ログイン名
|
user_pass |
varchar(64) |
|
|
|
|
パスワード(暗号化)
|
user_nicename |
varchar(50) |
|
IND |
|
|
|
user_email |
varchar(100) |
|
|
|
|
Eメールアドレス
|
user_url |
varchar(100) |
|
|
|
|
webサイト URI
|
user_registered |
datetime |
|
|
0000-00-00 00:00:00 |
|
登録日時
|
user_level |
int(2) unsigned |
|
|
0 |
|
|
user_activation_key |
varchar(60) |
|
|
|
|
|
user_status |
int(11) |
|
|
0 |
|
|
display_name |
varchar(250) |
|
|
|
|
表示名
|
インデックス
キー名 |
種別 |
一意な値の数 |
フィールド
|
PRIMARY |
PRIMARY |
1 |
ID
|
user_login_key |
INDEX |
None |
user_login
|
user_nicename |
INDEX |
None |
user_nicename
|
マルチサイトテーブル一覧
This section is the overview of the tables created for use with the Multisite feature of WordPress. These tables are created via the processes under Administration > Tools > Network.
These tables are considered the multisite global tables.
This section is the overview of the tables created for use with the Multisite feature of WordPress. These tables are created via the processes under Administration > Tools > Network.
These tables are considered the multisite global tables.
WordPress 3.0 Multisite Tables
|
Table Name |
Description |
Relevant Area(s) of WordPress User Interface
|
wp_blogs
|
Each site created is stored in the table, wp_blogs. |
|
wp_blog_versions
|
The current database version status of each site is maintained in the wp_blogs_versions table and is updated as each site is upgraded. |
|
wp_registration_log
|
The wp_registration_log records the admin user created when each new site is created. |
|
wp_signups
|
This table holds the user that have registered for a site via the login registration process. User registration is enable in Administration > Super Admin > Options. |
|
wp_site
|
The wp_site table contains the main site address. |
|
wp_sitecategories
|
If global terms (global_terms_enabled = true) are enabled for a site the wp_sitecategories table holds those terms. |
|
wp_sitemeta
|
Each site features information called the site data and it is stored in wp_sitemeta. Various option information, including the site admin is kept in this table. |
|
wp_users
|
The list of all users is maintained in table wp_users. Multisite add two fields not in the stand-alone version. |
|
wp_usermeta
|
This table is not re-create for multisite, but meta data of users for each site are stored in wp_usermeta. |
|
Site Specific Tables
|
The data of the main site are stored in existing unnumbered tables. The data of additional sites are stored in new numbered tables.
|
|
マルチサイトテーブル詳細
The following describe the tables and fields created during the network installation. Note that a global set of tables is created upon creation of the network, and site-specific tables are established as each site is created.
Table: wp_blogs
Field |
Type |
Null |
Key |
Default |
Extra
|
blog_id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment
|
site_id |
bigint(20) unsigned |
|
IND |
0 |
|
domain |
varchar(200) |
NO |
|
0 |
|
path |
varchar(100) |
NO |
|
|
|
registered |
datetime |
NO |
|
0000-00-00 00:00:00 |
|
last_updated |
datetime |
NO |
|
0000-00-00 00:00:00 |
|
public |
tinyint(2) |
NO |
|
0 |
|
archived |
enum('0','1') |
NO |
|
0 |
|
mature |
tinyint(2) |
NO |
|
0 |
|
spam |
tinyint(2) |
NO |
|
0 |
|
deleted |
tinyint(2) |
NO |
|
0 |
|
lang_id |
int(11) |
NO |
|
0 |
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
2 |
blog_id
|
domain |
INDEX |
none |
domain(50),path(5)
|
lang_id |
INDEX |
none |
lang_id
|
Table: wp_blog_versions
Field |
Type |
Null |
Key |
Default |
Extra
|
blog_id |
bigint(20) unsigned |
|
PRI |
0 |
FK->wp_blogs.blog_id
|
db_version |
varchar(20) |
NO |
|
|
|
last_updated |
datetime |
NO |
|
0000-00-00 00:00:00 |
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
2 |
blog_id
|
db_version |
INDEX |
none |
db_version
|
Table: wp_registration_log
Field |
Type |
Null |
Key |
Default |
Extra
|
ID |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment
|
email |
varchar(255) |
NO |
|
|
|
IP |
varchar(30) |
NO |
|
|
|
blog_id |
bigint(20) unsigned |
|
PRI |
0 |
FK->wp_blogs.blog_id
|
date_registered |
datetime |
NO |
|
0000-00-00 00:00:00 |
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
1 |
ID
|
IP |
INDEX |
none |
IP
|
Table: wp_signups
Field |
Type |
Null |
Key |
Default |
Extra
|
domain |
varchar(200) |
NO |
|
0 |
|
path |
varchar(100) |
NO |
|
|
|
title |
longtext |
NO |
|
|
|
user_login |
varchar(60) |
NO |
IND |
|
|
user_email |
varchar(100) |
NO |
|
|
|
registered_date |
datetime |
NO |
|
0000-00-00 00:00:00 |
|
activated |
datetime |
NO |
|
0000-00-00 00:00:00 |
|
active |
tinyint(1) |
NO |
|
|
|
activation_key |
varchar(50) |
NO |
|
|
|
meta |
longtext |
|
|
|
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
activation_key |
INDEX |
None |
activation_key
|
domain |
INDEX |
None |
domain
|
Table: wp_site
Field |
Type |
Null |
Key |
Default |
Extra
|
id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment
|
domain |
varchar(200) |
NO |
|
0 |
|
path |
varchar(100) |
NO |
|
|
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
1 |
id
|
domain |
INDEX |
none |
domain,path
|
Table: wp_sitecategories
Field |
Type |
Null |
Key |
Default |
Extra
|
cat_id |
bigint(20) unsigned |
NO |
PRI |
NULL |
auto_increment
|
cat_name |
carchar(55) |
NO |
|
|
|
category_nicename |
varchar(200) |
NO |
|
|
|
last_updated |
timestamp |
NO |
|
|
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
9 |
cat_id
|
category_nicename |
INDEX |
None |
category_nicename
|
last_updated |
INDEX |
None |
last_updated
|
Table: wp_sitemeta
Field |
Type |
Null |
Key |
Default |
Extra
|
meta_id |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment
|
site_id |
bigint(20) unsigned |
|
|
'0' |
FK->wp_site.site_id
|
meta_key |
varchar(255) |
Yes |
IND |
NULL |
|
meta_value |
longtext |
Yes |
IND |
NULL |
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
9 |
meta_id
|
meta_key |
INDEX |
None |
meta_key
|
site_id |
INDEX |
None |
site_id
|
Table: wp_users
Field |
Type |
Null |
Key |
Default |
Extra
|
ID |
bigint(20) unsigned |
|
PRI |
NULL |
auto_increment
|
user_login |
varchar(60) |
|
IND |
|
|
user_pass |
varchar(64) |
|
|
|
|
user_nicename |
varchar(50) |
|
IND |
|
|
user_email |
varchar(100) |
|
|
|
|
user_url |
varchar(100) |
|
|
|
|
user_registered |
datetime |
|
|
0000-00-00 00:00:00 |
|
user_activation_key |
varchar(60) |
|
|
|
|
user_status |
int(11) |
|
|
0 |
|
display_name |
varchar(250) |
|
|
|
|
spam |
tinyint(2) |
NO |
|
0 |
|
deleted |
tinyint(2) |
NO |
|
0 |
|
Indexes
Keyname |
Type |
Cardinality |
Field
|
PRIMARY |
PRIMARY |
1 |
ID
|
user_login_key |
INDEX |
None |
user_login
|
user_nicename |
INDEX |
None |
user_nicename
|
個別サイトテーブル
When a new additional site is created, the site-specific tables, similar to the stand-alone tables above, are created. Each set of tables for a site are created with the site ID (blog_id
) as part of the table name. These are the tables that would be created for site ID 2 and table_prefix wp:
The data of the main site are stored in unnumbered tables.
資料
旧バージョンのデータベース概要
変更履歴
- 2.8 :
- comments テーブル:
comment_post_ID
フィールドが int(11)
から bigint(20) unsigned
へ変更されました。
- links テーブル:
-
link_category
フィールドが削除されました。
-
link_owner
フィールドが int(11)
から bigint(20) unsigned
へ変更されました。
- posts テーブル:
-
post_category
フィールドが削除されました。
- 草稿データにも
post_date
を格納するようになりました。
- term_taxonomy テーブル: KEY に
taxonomy
が追加されました。
- ほとんどの
bigint(20)
フィールドに unsigned
属性が追加されました。
(commentsテーブル)comment_parent
, user_id
, (linksテーブル)link_id
, (optionsテーブル)option_id
, (metaテーブル)meta_id
, post_id
, (postsテーブル)post_author
, post_parent
, (termsテーブル)term_id
, (term_relationshipsテーブル)object_id
, term_taxonomy_id
, (term_taxonomyテーブル)term_taxonomy_id
, term_id
, parent
, (usermetaテーブル)umeta_id
, user_id
- 2.7 :
- 2.6 : 投稿の改訂履歴データを持つようになりました。
- 2.5 :
- 2.3 :
-
categories
、link2cat
、post2cat
テーブル廃止、terms
、term_taxonomy
、term_relationships
テーブル追加。
- options テーブルより 6フィールド削除。(
option_can_override
, option_type
, option_width
, option_height
, option_description
, option_admin_level
)
- posts テーブルの
post_status
フィールドに新規ステータス 'pending'
を追加。
- 参考: プラグインとテーマの移行 - 2.2 から 2.3 への移行
- 2.1 :
最新英語版: WordPress Codex » Database Description (最新版との差分)