Manual:SQL patch file/ja

You might write an SQL file either for a schema change in the core (see Development_policy#Database_patches, ) or for an extension (see ). See also the.

例
テーブルを作成するための SQL ファイルは、以下のようになるでしょう:

変数の置換
The first two need to be used in patch files, as in the example above.


 * は に置換されます.
 * はインデックスの接頭辞に置換されます. (This was only ever used for a small number of core tables and has been removed in MediaWiki 1.35, so in practice this does not make any difference.)
 * は の値に置換されます.
 * is only used for database backends.

There are other variable replacements but they are not used in practice. See the documentation of Database::replaceVars for the full list.

外部リンク

 * W3Schools, CREATE TABLE
 * W3Schools, ALTER TABLE - 列の追加、変更、削除に使用されます