Translations:Manual:SQL patch file/1/en

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