ラベル

Server (108) work (77) Idea (68) Car (31) PC (29) DAW (28) other (19) MakingWEBsite (18) 趣味 (18) health (13) CentOS (11) drupal (11) 山 (9) android (4) スマホ (4) communication (3) drupal7 (3) hint (3) meno (3) モバイル (3) 歯医者 (3) 第二種電気工事士 (3) 英語 (3) PC Server (2) drupal8 (2) ms access (2) uwp C# (2) めし (2) 整備 (2) 音楽 (2) MIDI (1) diy (1) 会計 (1) 動画再生 (1) 生活 (1) 郵便 (1) 食べ物 (1)

2014年7月10日木曜日

drupal 7 field 追加 テーブル名 フィールド名 table field

データベース上の値をクエリを使ってコンテンツに表示しようと思って、データベース上のテーブル名、フィールド名などを確認した。その時のメモ。

admin/config/people/accounts/fields
で、フィールドを追加した後、mysqlなどのデータベースに保存される時に作られるテーブル名など。

テーブル名は「field_data_field_ラベル名」
(ラベル名=フィールド名)

そのテーブルの中のフィールド、「field_ラベル名_*」は、フィールドタイプに何を何を使いたいのか、ウィジェットに何を選択するかによって「*」の所が変わってくる。データを保存するときのデータ型も変わってくる(データ型の違いを忘れると、sqlを実行したときにあっちとこっちの保存形式の違いからエラーが出ることがある。)。

field_ラベル名_tid------Taxonomyなどからセレクトリストを選んだとき、ここにタクソノミーのid。

field_ラベル名_value----Textなどを選んだときは、このfieldに自分の記入したテキストが入る。

その他のフィールドは、
例えば、フィールドentity_typeの値がuserで、フィールドentity_idが1であったときにはユーザーIDが1の人のプロフィールの値ということになる。

Taxonomy関係
テーブル
taxonomy_term_data
フィールド
tid----タームの通し番号
vid---VOCABULARY NAME毎につける番号
name---タームの名前
description---タームのdescription
format------format
weight------weight

テーブル
taxonomy_vocabulary
フィールド
vid
Primary Key: Unique vocabulary ID.
name
Name of the vocabulary.
machine_name
The vocabulary machine name.PC内部名(ボキャブラリー名を日本語で入れなければ大概、nameと同じに登録される)
description
Description of the vocabulary.
hierarchy
The type of hierarchy allowed within the vocabulary. (0 = disabled, 1 = single, 2 = multiple)
module
The module which created the vocabulary.
weight
The weight of this vocabulary in relation to other vocabularies.

テーブル名
taxonomy_term_hierarchy
タームの親と子の関係を表している。
フィールド名
tid
Primary Key: The taxonomy_term_data.tid of the term.
parent
Primary Key: The taxonomy_term_data.tid of the term’s parent. 0 indicates no parent


0 件のコメント:

コメントを投稿