Manual:Coding conventions/Database/en

This page describes the coding conventions used within files of the MediaWiki codebase written for usage with a Database. See also the general conventions that apply to all program languages, including those for databases. If you would like a short checklist to help you review your commits, try using the.

MySQL/MariaDB
Use abstract schema for new tables or schema changes. See for more information.

Table naming

 * Table names should be singular nouns:,  ,  , etc. There are some historical exceptions:  ,  …
 * Column names are given a prefix derived from the table name: the name itself if it's short, or an abbreviation:

Changing the schema
See Development policy#Database_patches, especially Special:Diff/537762/prev and make sure you use abstract schema changes.