X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FDefines.php;h=8ac84e5ab5343ca5dc4937fdce833a8cc8e47efe;hb=3431ab6d07a119e928aa1538a49984e790dc6ce7;hp=35c2a2d8adea2ff5edcbe0389ff20f719bb093aa;hpb=cf3221a3d5d6761bd43d2ad29619636055831ce1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Defines.php b/includes/Defines.php index 35c2a2d8ad..8ac84e5ab5 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -21,10 +21,11 @@ */ require_once __DIR__ . '/libs/mime/defines.php'; -require_once __DIR__ . '/libs/time/defines.php'; require_once __DIR__ . '/libs/rdbms/defines.php'; require_once __DIR__ . '/compat/normal/UtfNormalDefines.php'; +use Wikimedia\Rdbms\IDatabase; + /** * @defgroup Constants MediaWiki constants */ @@ -266,3 +267,28 @@ define( 'CONTENT_FORMAT_XML', 'application/xml' ); */ define( 'SHELL_MAX_ARG_STRLEN', '100000' ); /**@}*/ + +/**@{ + * Schema change migration flags. + * + * Used as values of a feature flag for an orderly transition from an old + * schema to a new schema. + * + * - MIGRATION_OLD: Only read and write the old schema. The new schema need not + * even exist. This is used from when the patch is merged until the schema + * change is actually applied to the database. + * - MIGRATION_WRITE_BOTH: Write both the old and new schema. Read the new + * schema preferentially, falling back to the old. This is used while the + * change is being tested, allowing easy roll-back to the old schema. + * - MIGRATION_WRITE_NEW: Write only the new schema. Read the new schema + * preferentially, falling back to the old. This is used while running the + * maintenance script to migrate existing entries in the old schema to the + * new schema. + * - MIGRATION_NEW: Only read and write the new schema. The old schema (and the + * feature flag) may now be removed. + */ +define( 'MIGRATION_OLD', 0 ); +define( 'MIGRATION_WRITE_BOTH', 1 ); +define( 'MIGRATION_WRITE_NEW', 2 ); +define( 'MIGRATION_NEW', 3 ); +/**@}*/