<ruleset name="MediaWiki">
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="Generic.ControlStructures.InlineControlStructure" />
+ <exclude name="MediaWiki.Commenting.FunctionAnnotations.UnrecognizedAnnotation" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
<exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
+ <exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
- <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
- <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
<exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
+ <exclude name="MediaWiki.Usage.ForbiddenFunctions.passthru" />
<exclude name="MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle" />
+ <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
+ <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
<exclude name="Squiz.Scope.MethodScope.Missing" />
<exclude name="Squiz.Scope.MemberVarScope.Missing" />
- <exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
</rule>
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
<properties>
<property name="ignoreList" type="array" value="$IP,$messageMemc" />
</properties>
</rule>
+ <rule ref="MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix">
+ <exclude-pattern>profileinfo\.php</exclude-pattern>
+ <exclude-pattern>maintenance/language/checkLanguage\.inc</exclude-pattern>
+ <exclude-pattern>maintenance/doMaintenance\.php</exclude-pattern>
+ <exclude-pattern>maintenance/mergeMessageFileList\.php</exclude-pattern>
+ <exclude-pattern>maintenance/commandLine\.inc</exclude-pattern>
+ </rule>
<rule ref="Generic.Files.LineLength">
<exclude-pattern>*/languages/messages/Messages*\.php</exclude-pattern>
</rule>
MediaWiki is developed and tested mainly on Unix/Linux platforms, but should
work on Windows as well.
-If your PHP is configured as a CGI plug-in rather than an Apache module you may
-experience problems, as this configuration is not well tested.
-
Support for rendering mathematical formulas requires installing the Math extension,
see https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Math
* The archive table's ar_rev_id field is now unique.
* Special:BotPasswords now requires reauthentication.
* (T194414) The default watchlist view time has been increased from 3 to 7 days.
+* The right to edit sitewide Javascript (e.g. MediaWiki:Common.js), CSS or JSON
+ was separated from 'editinterface' and is available under
+ 'editsitejs'/'editsitecss'/'editsitejson'. Having 'editinterface' is still
+ necessary to edit such pages.
+* A new user group, 'interface-admin', is added for controlling access to
+ sitewide CSS/JS (and editing other users' CSS/JS). No other group has
+ 'editsitecss', 'editusercss', 'editsitejs' or 'edituserjs' by default.
+* A new grant group, 'editsiteconfig', is added for granting the above rights.
=== New features in 1.32 ===
* (T112474) Generalized the ResourceLoader mechanism for overriding modules
* Added new 'OutputPageAfterGetHeadLinksArray' hook, allowing extensions to
modify the return value of OutputPage#getHeadLinksArray in order to add,
remove or otherwise alter the elements to be output in the page <head>.
+* (T28934) The 'HistoryPageToolLinks' hook allows extensions to append
+ additional links to the subtitle of a history page.
=== External library changes in 1.32 ===
* …
* Updated wikimedia/scoped-callback from 1.0.0 to 2.0.0.
** ScopedCallback objects can no longer be serialized.
* Updated wikimedia/wrappedstring from 2.3.0 to 3.0.1.
+* Updated mediawiki/mediawiki-codesniffer from v20.0.0 to v21.0.0.
+* Updated composer/spdx-licenses from 1.3.0 to 1.4.0.
==== New external libraries ====
* Added wikimedia/xmp-reader 0.5.1
mNewPage, mOldContent, mNewContent, mRevisionsLoaded, mTextLoaded and
mCacheHit is deprecated. Use getOldid() / getNewid() for the first two,
do your own lookup for page/content. mNewRev / mOldRev remains public.
+* The $wgExternalDiffEngine value 'wikidiff2' is deprecated. To use wikidiff2
+ just enable the PHP extension, and it will be autodetected.
=== Other changes in 1.32 ===
* (T198811) The following tables have had their UNIQUE indexes turned into
},
"require-dev": {
"cache/integration-tests": "0.16.0",
- "composer/spdx-licenses": "1.3.0",
+ "composer/spdx-licenses": "1.4.0",
"hamcrest/hamcrest-php": "^2.0",
"jakub-onderka/php-parallel-lint": "0.9.2",
- "jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
+ "jetbrains/phpstorm-stubs": "dev-master#38ff1a581b297f7901e961b8c923862ea80c3b96",
"justinrainbow/json-schema": "~5.2",
- "mediawiki/mediawiki-codesniffer": "20.0.0",
+ "mediawiki/mediawiki-codesniffer": "21.0.0",
"monolog/monolog": "~1.22.1",
"nikic/php-parser": "3.1.3",
"seld/jsonlint": "1.7.1",
$prevRev: Revision object, next in line in page history, or null
$user: Current user object
+'HistoryPageToolLinks': Add one or more links to revision history page subtitle.
+$context: IContextSource (object)
+$linkRenderer: LinkRenderer instance
+&$links: Array of HTML strings
+
'HTMLFileCache::useFileCache': Override whether a page should be cached in file
cache.
$context: An IContextSource object with information about the request being
* just that it was. If you want to change this, you can set $wgImgAuthDetails to 'true'
* in localsettings.php and it will give the user the reason why access was denied.
*
- * Your server needs to support PATH_INFO; CGI-based configurations usually don't.
+ * Your server needs to support REQUEST_URI or PATH_INFO; CGI-based
+ * configurations sometimes don't.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
'PasswordCannotMatchUsername' => true,
'PasswordCannotBePopular' => 25,
],
+ 'interface-admin' => [
+ 'MinimalPasswordLength' => 8,
+ 'MinimumPasswordLengthToLogin' => 1,
+ 'PasswordCannotMatchUsername' => true,
+ 'PasswordCannotBePopular' => 25,
+ ],
'bot' => [
'MinimalPasswordLength' => 8,
'MinimumPasswordLengthToLogin' => 1,
$wgGroupPermissions['sysop']['deletedtext'] = true;
$wgGroupPermissions['sysop']['undelete'] = true;
$wgGroupPermissions['sysop']['editinterface'] = true;
-$wgGroupPermissions['sysop']['editusercss'] = true;
+$wgGroupPermissions['sysop']['editsitejson'] = true;
$wgGroupPermissions['sysop']['edituserjson'] = true;
-$wgGroupPermissions['sysop']['edituserjs'] = true;
$wgGroupPermissions['sysop']['import'] = true;
$wgGroupPermissions['sysop']['importupload'] = true;
$wgGroupPermissions['sysop']['move'] = true;
$wgGroupPermissions['sysop']['managechangetags'] = true;
$wgGroupPermissions['sysop']['deletechangetags'] = true;
+$wgGroupPermissions['interface-admin']['editinterface'] = true;
+$wgGroupPermissions['interface-admin']['editsitecss'] = true;
+$wgGroupPermissions['interface-admin']['editsitejson'] = true;
+$wgGroupPermissions['interface-admin']['editsitejs'] = true;
+$wgGroupPermissions['interface-admin']['editusercss'] = true;
+$wgGroupPermissions['interface-admin']['edituserjson'] = true;
+$wgGroupPermissions['interface-admin']['edituserjs'] = true;
+
// Permission to change users' group assignments
$wgGroupPermissions['bureaucrat']['userrights'] = true;
$wgGroupPermissions['bureaucrat']['noratelimit'] = true;
$wgGrantPermissions['editinterface'] = $wgGrantPermissions['editpage'];
$wgGrantPermissions['editinterface']['editinterface'] = true;
-$wgGrantPermissions['editinterface']['editusercss'] = true;
$wgGrantPermissions['editinterface']['edituserjson'] = true;
-$wgGrantPermissions['editinterface']['edituserjs'] = true;
+$wgGrantPermissions['editinterface']['editsitejson'] = true;
+
+$wgGrantPermissions['editsiteconfig'] = $wgGrantPermissions['editinterface'];
+$wgGrantPermissions['editsiteconfig']['editusercss'] = true;
+$wgGrantPermissions['editsiteconfig']['edituserjs'] = true;
+$wgGrantPermissions['editsiteconfig']['editsitecss'] = true;
+$wgGrantPermissions['editsiteconfig']['editsitejs'] = true;
$wgGrantPermissions['createeditmovepage'] = $wgGrantPermissions['editpage'];
$wgGrantPermissions['createeditmovepage']['createpage'] = true;
'editmyoptions' => 'customization',
'editinterface' => 'administration',
+ 'editsiteconfig' => 'administration',
'rollback' => 'administration',
'blockusers' => 'administration',
'delete' => 'administration',
* Returns the revision that was current at the time editing was initiated on the client,
* even if the edit was based on an old revision.
*
- * @warning: this method is very poorly named. If the user opened the form with ?oldid=X,
+ * @warning this method is very poorly named. If the user opened the form with ?oldid=X,
* one might think of X as the "base revision", which is NOT what this returns,
* see oldid for that. One might further assume that this corresponds to the $baseRevId
* parameter of WikiPage::doEditContent, which is not the case either.
// Give grep a chance to find the usages:
// grant-blockusers, grant-createeditmovepage, grant-delete,
// grant-editinterface, grant-editmycssjs, grant-editmywatchlist,
- // grant-editpage, grant-editprotected, grant-highvolume,
- // grant-oversight, grant-patrol, grant-protect, grant-rollback,
- // grant-sendemail, grant-uploadeditmovefile, grant-uploadfile,
- // grant-basic, grant-viewdeleted, grant-viewmywatchlist,
- // grant-createaccount
+ // grant-editsiteconfig, grant-editpage, grant-editprotected,
+ // grant-highvolume, grant-oversight, grant-patrol, grant-protect,
+ // grant-rollback, grant-sendemail, grant-uploadeditmovefile,
+ // grant-uploadfile, grant-basic, grant-viewdeleted,
+ // grant-viewmywatchlist, grant-createaccount
$msg = wfMessage( "grant-$grant" );
if ( $lang !== null ) {
if ( is_string( $lang ) ) {
/**
* Set the title of the revision
*
- * @deprecated: since 1.31, this is now a noop. Pass the Title to the constructor instead.
+ * @deprecated since 1.31, this is now a noop. Pass the Title to the constructor instead.
*
* @param Title $title
*/
* used to determine the content model to use. If no title is know, CONTENT_MODEL_WIKITEXT
* is used as a last resort.
*
- * @todo: drop this, with MCR, there no longer is a single model associated with a revision.
+ * @todo drop this, with MCR, there no longer is a single model associated with a revision.
*
* @return string The content model id associated with this revision,
* see the CONTENT_MODEL_XXX constants.
* If no content format was stored in the database, the default format for this
* revision's content model is returned.
*
- * @todo: drop this, the format is irrelevant to the revision!
+ * @todo drop this, the format is irrelevant to the revision!
*
* @return string The content format id associated with this revision,
* see the CONTENT_FORMAT_XXX constants.
/**
* Returns a list of status messages of the given type (or all if false)
*
- * @note: this handles RawMessage poorly
+ * @note this handles RawMessage poorly
*
* @param string|bool $type
* @return array
*
* @see docs/pageupdater.txt for more information on when thie method can and should be called.
*
- * @note: Calling this method more than once with the same $slotsUpdate
+ * @note Calling this method more than once with the same $slotsUpdate
* has no effect. Calling this method multiple times with different content will cause
* an exception.
*
- * @note: Calling this method after prepareUpdate() has been called will cause an exception.
+ * @note Calling this method after prepareUpdate() has been called will cause an exception.
*
* @param User $user The user to act as context for pre-save transformation (PST).
* Type hint should be reduced to UserIdentity at some point.
/**
* Whether the edit created, or should create, a new revision (that is, it's not a null-edit).
*
- * @warning: at present, "null-revisions" that do not change content but do have a revision
+ * @warning at present, "null-revisions" that do not change content but do have a revision
* record would return false after prepareContent(), but true after prepareUpdate()!
* This should probably be fixed.
*
*
* @see docs/pageupdater.txt for more information on when thie method can and should be called.
*
- * @note: Calling this method more than once with the same revision has no effect.
+ * @note Calling this method more than once with the same revision has no effect.
* $options are only used for the first call. Calling this method multiple times with
* different revisions will cause an exception.
*
- * @note: If grabCurrentRevision() (or prepareContent()) has been called before
+ * @note If grabCurrentRevision() (or prepareContent()) has been called before
* calling this method, $revision->getParentRevision() has to refer to the revision that
* was the current revision at the time grabCurrentRevision() was called.
*
/**
* Computes the total nominal size of the revision's slots, in bogo-bytes.
*
- * @warn This is potentially expensive! It may cause all slot's content to be loaded
+ * @warning This is potentially expensive! It may cause all slot's content to be loaded
* and deserialized.
*
* @return int
* is that slot's hash. For consistency, the combined hash of an empty set of slots
* is the hash of the empty string.
*
- * @warn This is potentially expensive! It may cause all slot's content to be loaded
+ * @warning This is potentially expensive! It may cause all slot's content to be loaded
* and deserialized, then re-serialized and hashed.
*
* @return string
* Such revisions can for instance identify page rename
* operations and other such meta-modifications.
*
- * @note: This method grabs a FOR UPDATE lock on the relevant row of the page table,
+ * @note This method grabs a FOR UPDATE lock on the relevant row of the page table,
* to prevent a new revision from being inserted before the null revision has been written
* to the database.
*
public static function newFromTextThrow( $text, $defaultNamespace = NS_MAIN ) {
if ( is_object( $text ) ) {
throw new MWException( '$text must be a string, given an object' );
+ } elseif ( $text === null ) {
+ // Legacy code relies on MalformedTitleException being thrown in this case
+ // (happens when URL with no title in it is parsed). TODO fix
+ throw new MalformedTitleException( 'title-invalid-empty' );
}
$titleCache = self::getTitleCache();
*/
public function isSiteConfigPage() {
return (
- NS_MEDIAWIKI == $this->mNamespace
- && (
- $this->hasContentModel( CONTENT_MODEL_CSS )
- || $this->hasContentModel( CONTENT_MODEL_JSON )
- || $this->hasContentModel( CONTENT_MODEL_JAVASCRIPT )
- )
+ $this->isSiteCssConfigPage()
+ || $this->isSiteJsonConfigPage()
+ || $this->isSiteJsConfigPage()
);
}
*/
public function isUserConfigPage() {
return (
- NS_USER == $this->mNamespace
- && $this->isSubpage()
- && (
- $this->hasContentModel( CONTENT_MODEL_CSS )
- || $this->hasContentModel( CONTENT_MODEL_JSON )
- || $this->hasContentModel( CONTENT_MODEL_JAVASCRIPT )
- )
+ $this->isUserCssConfigPage()
+ || $this->isUserJsonConfigPage()
+ || $this->isUserJsConfigPage()
);
}
return $this->isUserJsConfigPage();
}
+ /**
+ * Is this a sitewide CSS "config" page?
+ *
+ * @return bool
+ * @since 1.32
+ */
+ public function isSiteCssConfigPage() {
+ return (
+ NS_MEDIAWIKI == $this->mNamespace
+ && (
+ $this->hasContentModel( CONTENT_MODEL_CSS )
+ // paranoia - a MediaWiki: namespace page with mismatching extension and content
+ // model is probably by mistake and might get handled incorrectly (see e.g. T112937)
+ || substr( $this->getDBkey(), -4 ) === '.css'
+ )
+ );
+ }
+
+ /**
+ * Is this a sitewide JSON "config" page?
+ *
+ * @return bool
+ * @since 1.32
+ */
+ public function isSiteJsonConfigPage() {
+ return (
+ NS_MEDIAWIKI == $this->mNamespace
+ && (
+ $this->hasContentModel( CONTENT_MODEL_JSON )
+ // paranoia - a MediaWiki: namespace page with mismatching extension and content
+ // model is probably by mistake and might get handled incorrectly (see e.g. T112937)
+ || substr( $this->getDBkey(), -5 ) === '.json'
+ )
+ );
+ }
+
+ /**
+ * Is this a sitewide JS "config" page?
+ *
+ * @return bool
+ * @since 1.31
+ */
+ public function isSiteJsConfigPage() {
+ return (
+ NS_MEDIAWIKI == $this->mNamespace
+ && (
+ $this->hasContentModel( CONTENT_MODEL_JAVASCRIPT )
+ // paranoia - a MediaWiki: namespace page with mismatching extension and content
+ // model is probably by mistake and might get handled incorrectly (see e.g. T112937)
+ || substr( $this->getDBkey(), -3 ) === '.js'
+ )
+ );
+ }
+
/**
* Is this a talk page of some sort?
*
return $errors;
}
+ /**
+ * Check sitewide CSS/JSON/JS permissions
+ *
+ * @param string $action The action to check
+ * @param User $user User to check
+ * @param array $errors List of current errors
+ * @param string $rigor Same format as Title::getUserPermissionsErrors()
+ * @param bool $short Short circuit on first error
+ *
+ * @return array List of errors
+ */
+ private function checkSiteConfigPermissions( $action, $user, $errors, $rigor, $short ) {
+ if ( $action != 'patrol' ) {
+ // Sitewide CSS/JSON/JS changes, like all NS_MEDIAWIKI changes, also require the
+ // editinterface right. That's implemented as a restriction so no check needed here.
+ if ( $this->isSiteCssConfigPage() && !$user->isAllowed( 'editsitecss' ) ) {
+ $errors[] = [ 'sitecssprotected', $action ];
+ } elseif ( $this->isSiteJsonConfigPage() && !$user->isAllowed( 'editsitejson' ) ) {
+ $errors[] = [ 'sitejsonprotected', $action ];
+ } elseif ( $this->isSiteJsConfigPage() && !$user->isAllowed( 'editsitejs' ) ) {
+ $errors[] = [ 'sitejsprotected', $action ];
+ }
+ }
+
+ return $errors;
+ }
+
/**
* Check CSS/JSON/JS sub-page permissions
*
'checkReadPermissions',
'checkUserBlock', // for wgBlockDisablesLogin
];
- # Don't call checkSpecialsAndNSPermissions or checkUserConfigPermissions
- # here as it will lead to duplicate error messages. This is okay to do
- # since anywhere that checks for create will also check for edit, and
- # those checks are called for edit.
+ # Don't call checkSpecialsAndNSPermissions, checkSiteConfigPermissions
+ # or checkUserConfigPermissions here as it will lead to duplicate
+ # error messages. This is okay to do since anywhere that checks for
+ # create will also check for edit, and those checks are called for edit.
} elseif ( $action == 'create' ) {
$checks = [
'checkQuickPermissions',
'checkQuickPermissions',
'checkPermissionHooks',
'checkSpecialsAndNSPermissions',
+ 'checkSiteConfigPermissions',
'checkUserConfigPermissions',
'checkPageRestrictions',
'checkCascadingSourcesRestrictions',
protected function getDescription() {
// Creation of a subtitle link pointing to [[Special:Log]]
- return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
+ $subtitle = $linkRenderer->makeKnownLink(
SpecialPage::getTitleFor( 'Log' ),
$this->msg( 'viewpagelogs' )->text(),
[],
[ 'page' => $this->getTitle()->getPrefixedText() ]
);
+
+ $links = [];
+ // Allow extensions to add more links
+ Hooks::run( 'HistoryPageToolLinks', [ $this->getContext(), $linkRenderer, &$links ] );
+ if ( $links ) {
+ $subtitle .= ''
+ . $this->msg( 'word-separator' )->escaped()
+ . $this->msg( 'parentheses' )
+ ->rawParams( $this->getLanguage()->pipeList( $links ) )
+ ->escaped();
+ }
+ return $subtitle;
}
/**
/**
* Update link tables with outgoing links from an updated article
*
- * @note: this is managed by DeferredUpdates::execute(). Do not run this in a transaction.
+ * @note this is managed by DeferredUpdates::execute(). Do not run this in a transaction.
*/
public function doUpdate() {
if ( $this->ticket ) {
wfDeprecated( "\$wgExternalDiffEngine = '{$wgExternalDiffEngine}'", '1.27' );
$wgExternalDiffEngine = false;
} elseif ( $wgExternalDiffEngine == 'wikidiff2' ) {
- // Same as above, but with no deprecation warnings
+ wfDeprecated( "\$wgExternalDiffEngine = '{$wgExternalDiffEngine}'", '1.32' );
$wgExternalDiffEngine = false;
} elseif ( !is_string( $wgExternalDiffEngine ) && $wgExternalDiffEngine !== false ) {
// And prevent people from shooting themselves in the foot...
$dropdownInputAttribs['classes'] = [ $this->mClass ];
}
+ $disabled = false;
+ if ( isset( $this->mParams[ 'disabled' ] ) && $this->mParams[ 'disabled' ] ) {
+ $disabled = true;
+ }
+
return $this->getInputWidget( [
'id' => $this->mID,
+ 'disabled' => $disabled,
'textinput' => $textAttribs,
'dropdowninput' => $dropdownInputAttribs,
'or' => false,
$textAttribs['placeholder'] = $this->mPlaceholder;
}
+ $disabled = false;
+ if ( isset( $this->mParams[ 'disabled' ] ) && $this->mParams[ 'disabled' ] ) {
+ $disabled = true;
+ }
+
return $this->getInputWidget( [
'id' => $this->mID,
+ 'disabled' => $disabled,
'textinput' => $textAttribs,
'dropdowninput' => $dropdownAttribs,
'or' => true,
}
/**
- * Create the first user account, grant it sysop and bureaucrat rights
+ * Create the first user account, grant it sysop, bureaucrat and interface-admin rights
*
* @return Status
*/
$user->addGroup( 'sysop' );
$user->addGroup( 'bureaucrat' );
+ $user->addGroup( 'interface-admin' );
if ( $this->getVar( '_AdminEmail' ) ) {
$user->setEmail( $this->getVar( '_AdminEmail' ) );
}
[ 'migrateComments' ],
// 1.31
- [ 'addTable', 'slots', 'patch-slots.sql' ],
- [ 'addField', 'slots', 'slot_origin', 'patch-slot-origin.sql' ],
- [ 'addTable', 'content', 'patch-content.sql' ],
[ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ],
[ 'addTable', 'content_models', 'patch-content_models.sql' ],
+ [ 'addTable', 'content', 'patch-content.sql' ],
+ [ 'addTable', 'slots', 'patch-slots.sql' ],
+ [ 'addField', 'slots', 'slot_origin', 'patch-slot-origin.sql' ],
[ 'migrateArchiveText' ],
[ 'addTable', 'actor', 'patch-actor-table.sql' ],
[ 'migrateActors' ],
$status = $upp->checkUserPasswordForGroups(
$user,
$pwd,
- [ 'bureaucrat', 'sysop' ] // per Installer::createSysop()
+ [ 'bureaucrat', 'sysop', 'interface-admin' ] // per Installer::createSysop()
);
$valid = $status->isGood() ? true : $status->getMessage();
} else {
* Note that type parameters and accept extension like the "level" parameter
* are not supported, weights are derived from "q" values only.
*
- * @todo: If additional type parameters are present, ignore them cleanly.
+ * @todo If additional type parameters are present, ignore them cleanly.
* At present, they often confuse the result.
*
* See HTTP/1.1 section 14 for details.
}
/**
- * @TODO change this code to work in one batch
+ * @todo change this code to work in one batch
* @param string $lockSrv
* @param array $pathsByType
* @return StatusValue
abstract protected function doGet( $key, $flags = 0 );
/**
- * @note: This method is only needed if merge() uses mergeViaCas()
+ * @note This method is only needed if merge() uses mergeViaCas()
*
* @param string $key
* @param mixed &$casToken
const STATUS_TRX_NONE = 3;
/**
- * @note: exceptions for missing libraries/drivers should be thrown in initConnection()
+ * @note exceptions for missing libraries/drivers should be thrown in initConnection()
* @param array $params Parameters passed from Database::factory()
*/
protected function __construct( array $params ) {
/**
* Basic database interface for live and lazy-loaded relation database handles
*
- * @note: IDatabase and DBConnRef should be updated to reflect any changes
+ * @note IDatabase and DBConnRef should be updated to reflect any changes
* @ingroup Database
*/
interface IDatabase {
*
* This is useful for combining cooperative locks and DB transactions.
*
- * @note: do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
+ * @note do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
*
* The callback takes the following arguments:
* - How the transaction ended (IDatabase::TRIGGER_COMMIT or IDatabase::TRIGGER_ROLLBACK)
*
* Updates will execute in the order they were enqueued.
*
- * @note: do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
+ * @note do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
*
* The callback takes the following arguments:
* - How the transaction ended (IDatabase::TRIGGER_COMMIT or IDatabase::TRIGGER_IDLE)
* - The failures are from contention solvable via onTransactionPreCommitOrIdle()
* - The failures are deadlocks; the RDBMs usually discard the whole transaction
*
- * @note: callers must use additional measures for situations involving two or more
+ * @note callers must use additional measures for situations involving two or more
* (peer) transactions (e.g. updating two database servers at once). The transaction
* and savepoint logic of this method only applies to this specific IDatabase instance.
*
* corresponding startAtomic() implicitly started a transaction, that
* transaction is rolled back.
*
- * @note: callers must use additional measures for situations involving two or more
+ * @note callers must use additional measures for situations involving two or more
* (peer) transactions (e.g. updating two database servers at once). The transaction
* and savepoint logic of startAtomic() are bound to specific IDatabase instances.
*
* - oldid|revision: the revision ID
* @param OutputPage $output
*
- * @note: Instead of an output page, a WebResponse could be sufficient, but
+ * @note Instead of an output page, a WebResponse could be sufficient, but
* redirect logic is currently implemented in OutputPage.
*
* @throws HttpError
'class' => 'HTMLUserTextField',
'label-message' => 'specialloguserlabel',
'name' => 'user',
+ 'default' => $user,
];
}
/**
* Get the user language used by the parser for this page and split the parser cache.
*
- * @warning: Calling this causes the parser cache to be fragmented by user language!
+ * @warning Calling this causes the parser cache to be fragmented by user language!
* To avoid cache fragmentation, output should not depend on the user language.
* Use Parser::getFunctionLang() or Parser::getTargetLanguage() instead!
*
/**
* Same as getUserLangObj() but returns a string instead.
*
- * @warning: Calling this causes the parser cache to be fragmented by user language!
+ * @warning Calling this causes the parser cache to be fragmented by user language!
* To avoid cache fragmentation, output should not depend on the user language.
* Use Parser::getFunctionLang() or Parser::getTargetLanguage() instead!
*
/**
* @since 1.27
*
- * @todo: inject some kind of connection manager that is aware of the target wiki,
+ * @todo inject some kind of connection manager that is aware of the target wiki,
* instead of injecting a LoadBalancer.
*
* @param LoadBalancer $dbLoadBalancer
'editmyuserjs',
'editmywatchlist',
'editsemiprotected',
+ 'editsitecss',
+ 'editsitejson',
+ 'editsitejs',
'editusercss',
'edituserjson',
'edituserjs',
}
/**
- * @todo: move to MW-specific factory class and inject temp dir
+ * @todo move to MW-specific factory class and inject temp dir
* @return UIDGenerator
*/
protected static function singleton() {
$config
);
+ if ( isset( $config['disabled'] ) && $config['disabled'] == true ) {
+ $config['textinput']['disabled'] = true;
+ $config['dropdowninput']['disabled'] = true;
+ }
+
parent::__construct( $config );
// Properties
"customcssprotected": "You do not have permission to edit this CSS page because it contains another user's personal settings.",
"customjsonprotected": "You do not have permission to edit this JSON page because it contains another user's personal settings.",
"customjsprotected": "You do not have permission to edit this JavaScript page because it contains another user's personal settings.",
+ "sitecssprotected": "You do not have permission to edit this CSS page because it may affect all visitors",
+ "sitejsonprotected": "You do not have permission to edit this JSON page because it may affect all visitors",
+ "sitejsprotected": "You do not have permission to edit this JavaScript page because it may affect all visitors",
"mycustomcssprotected": "You do not have permission to edit this CSS page.",
"mycustomjsonprotected": "You do not have permission to edit this JSON page.",
"mycustomjsprotected": "You do not have permission to edit this JavaScript page.",
"group-autoconfirmed": "Autoconfirmed users",
"group-bot": "Bots",
"group-sysop": "Administrators",
+ "group-interface-admin": "Interface administrators",
"group-bureaucrat": "Bureaucrats",
"group-suppress": "Suppressors",
"group-all": "(all)",
"group-autoconfirmed-member": "{{GENDER:$1|autoconfirmed user}}",
"group-bot-member": "{{GENDER:$1|bot}}",
"group-sysop-member": "{{GENDER:$1|administrator}}",
+ "group-interface-admin-member": "{{GENDER:$1|interface administrator}}",
"group-bureaucrat-member": "{{GENDER:$1|bureaucrat}}",
"group-suppress-member": "{{GENDER:$1|suppressor}}",
"grouppage-user": "{{ns:project}}:Users",
"grouppage-autoconfirmed": "{{ns:project}}:Autoconfirmed users",
"grouppage-bot": "{{ns:project}}:Bots",
"grouppage-sysop": "{{ns:project}}:Administrators",
+ "grouppage-interface-admin": "{{ns:project}}:Interface administrators",
"grouppage-bureaucrat": "{{ns:project}}:Bureaucrats",
"grouppage-suppress": "{{ns:project}}:Suppress",
"right-read": "Read pages",
"right-editusercss": "Edit other users' CSS files",
"right-edituserjson": "Edit other users' JSON files",
"right-edituserjs": "Edit other users' JavaScript files",
+ "right-editsitecss": "Edit sitewide CSS",
+ "right-editsitejson": "Edit sitewide JSON",
+ "right-editsitejs": "Edit sitewide JavaScript",
"right-editmyusercss": "Edit your own user CSS files",
"right-editmyuserjson": "Edit your own user JSON files",
"right-editmyuserjs": "Edit your own user JavaScript files",
"grant-createaccount": "Create accounts",
"grant-createeditmovepage": "Create, edit, and move pages",
"grant-delete": "Delete pages, revisions, and log entries",
- "grant-editinterface": "Edit the MediaWiki namespace and user CSS/JSON/JavaScript",
+ "grant-editinterface": "Edit the MediaWiki namespace and sitewide/user JSON",
"grant-editmycssjs": "Edit your user CSS/JSON/JavaScript",
"grant-editmyoptions": "Edit your user preferences",
"grant-editmywatchlist": "Edit your watchlist",
+ "grant-editsiteconfig": "Edit sitewide and user CSS/JS",
"grant-editpage": "Edit existing pages",
"grant-editprotected": "Edit protected pages",
"grant-highvolume": "High-volume editing",
"uploadstash-zero-length": "File is zero length.",
"invalid-chunk-offset": "Invalid chunk offset",
"img-auth-accessdenied": "Access denied",
- "img-auth-nopathinfo": "Missing PATH_INFO.\nYour server is not set up to pass this information.\nIt may be CGI-based and cannot support img_auth.\nSee https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization.",
+ "img-auth-nopathinfo": "Missing path information.\nYour server must be set up to pass the REQUEST_URI and/or PATH_INFO variables.\nIf it is, try enabling $wgUsePathInfo.\nSee https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization.",
"img-auth-notindir": "Requested path is not in the configured upload directory.",
"img-auth-badtitle": "Unable to construct a valid title from \"$1\".",
"img-auth-nologinnWL": "You are not logged in and \"$1\" is not in the whitelist.",
"customcssprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
"customjsonprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
"customjsprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
+ "sitecssprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
+ "sitejsonprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
+ "sitejsprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
"mycustomcssprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
"mycustomjsonprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
"mycustomjsprotected": "Used as error message. Parameters:\n* $1 - (Unused) the action the user attempted to perform",
"group-autoconfirmed": "{{doc-group|autoconfirmed}}\nOn Wikimedia sites autoconfirmed users are users which are older than 4 days. After those 4 days, they have more rights.",
"group-bot": "{{doc-group|bot}}\n{{Identical|Bot}}",
"group-sysop": "{{doc-group|sysop}}\n{{Identical|Administrator}}",
+ "group-interface-admin": "{{doc-group|interface-admin}}",
"group-bureaucrat": "{{doc-group|bureaucrat}}",
"group-suppress": "{{doc-group|suppress}}\nThis is an optional (disabled by default) user group, meant for the suppression feature in [[mw:Flow|Flow]]. It is not to be confused with the Oversighters group, which also has access to the [[mw:RevisionDelete|RevisionDelete]] feature, to change the visibility of revisions through [[Special:RevisionDelete]].\n\n{{Identical|Suppress}}",
"group-all": "The name of the user group that contains all users, including anonymous users\n\n{{Identical|All}}",
"group-autoconfirmed-member": "{{doc-group|autoconfirmed|member}}",
"group-bot-member": "{{doc-group|bot|member}}",
"group-sysop-member": "{{doc-group|sysop|member}}\n{{Identical|Administrator}}",
+ "group-interface-admin-member": "{{doc-group|interface-admin|member}}",
"group-bureaucrat-member": "{{doc-group|bureaucrat|member}}",
"group-suppress-member": "{{doc-group|suppress|member}}\nThis is a member of the optional (disabled by default) user group, meant for the [[mw:RevisionDelete|RevisionDelete]] feature, to change the visibility of revisions through [[Special:RevisionDelete]].\n\n{{Identical|Suppress}}",
"grouppage-user": "{{doc-group|user|page}}\n{{Identical|User}}",
"grouppage-autoconfirmed": "{{doc-group|autoconfirmed|page}}",
"grouppage-bot": "{{doc-group|bot|page}}\n{{Identical|Bot}}",
"grouppage-sysop": "{{doc-group|sysop|page}}",
+ "grouppage-interface-admin": "{{doc-group|interface-admin|page}}",
"grouppage-bureaucrat": "{{doc-group|bureaucrat|page}}",
"grouppage-suppress": "{{doc-group|suppress|page}}\n{{Identical|Suppress}}",
"right-read": "{{doc-right|read}}\nBasic right to read any page.",
"right-editusercss": "{{doc-right|editusercss}}\nSee also:\n* {{msg-mw|Right-editmyusercss}}",
"right-edituserjson": "{{doc-right|edituserjson}}\nSee also:\n* {{msg-mw|Right-editmyuserjson}}",
"right-edituserjs": "{{doc-right|edituserjs}}\nSee also:\n* {{msg-mw|Right-editmyuserjs}}",
+ "right-editsitecss": "{{doc-right|editsitecss}}",
+ "right-editsitejson": "{{doc-right|editsitejson}}",
+ "right-editsitejs": "{{doc-right|editsitejs}}",
"right-editmyusercss": "{{doc-right|editmyusercss}}\nSee also:\n* {{msg-mw|Right-editusercss}}",
"right-editmyuserjson": "{{doc-right|editmyuserjson}}\nSee also:\n* {{msg-mw|Right-edituserjson}}",
"right-editmyuserjs": "{{doc-right|editmyuserjs}}\nSee also:\n* {{msg-mw|Right-edituserjs}}",
"right-applychangetags": "{{doc-right|applychangetags}}",
"right-changetags": "{{doc-right|changetags}}",
"right-deletechangetags": "{{doc-right|deletechangetags}}",
- "grant-generic": "Used if the grant name is not defined. Parameters:\n* $1 - grant name\n\nDefined grants (grant name refers: blockusers, createeditmovepage, ...):\n* {{msg-mw|grant-checkuser}}\n* {{msg-mw|grant-blockusers}}\n* {{msg-mw|grant-createaccount}}\n* {{msg-mw|grant-createeditmovepage}}\n* {{msg-mw|grant-delete}}\n* {{msg-mw|grant-editinterface}}\n* {{msg-mw|grant-editmycssjs}}\n* {{msg-mw|grant-editmyoptions}}\n* {{msg-mw|grant-editmywatchlist}}\n* {{msg-mw|grant-editpage}}\n* {{msg-mw|grant-editprotected}}\n* {{msg-mw|grant-highvolume}}\n* {{msg-mw|grant-oversight}}\n* {{msg-mw|grant-patrol}}\n* {{msg-mw|grant-privateinfo}}\n* {{msg-mw|grant-protect}}\n* {{msg-mw|grant-rollback}}\n* {{msg-mw|grant-sendemail}}\n* {{msg-mw|grant-uploadeditmovefile}}\n* {{msg-mw|grant-uploadfile}}\n* {{msg-mw|grant-basic}}\n* {{msg-mw|grant-viewdeleted}}\n* {{msg-mw|grant-viewmywatchlist}}",
+ "grant-generic": "Used if the grant name is not defined. Parameters:\n* $1 - grant name\n\nDefined grants (grant name refers: blockusers, createeditmovepage, ...):\n* {{msg-mw|grant-checkuser}}\n* {{msg-mw|grant-blockusers}}\n* {{msg-mw|grant-createaccount}}\n* {{msg-mw|grant-createeditmovepage}}\n* {{msg-mw|grant-delete}}\n* {{msg-mw|grant-editinterface}}\n* {{msg-mw|grant-editmycssjs}}\n* {{msg-mw|grant-editmyoptions}}\n* {{msg-mw|grant-editmywatchlist}}\n* {{msg-mw|grant-editsiteconfig}}\n* {{msg-mw|grant-editpage}}\n* {{msg-mw|grant-editprotected}}\n* {{msg-mw|grant-highvolume}}\n* {{msg-mw|grant-oversight}}\n* {{msg-mw|grant-patrol}}\n* {{msg-mw|grant-privateinfo}}\n* {{msg-mw|grant-protect}}\n* {{msg-mw|grant-rollback}}\n* {{msg-mw|grant-sendemail}}\n* {{msg-mw|grant-uploadeditmovefile}}\n* {{msg-mw|grant-uploadfile}}\n* {{msg-mw|grant-basic}}\n* {{msg-mw|grant-viewdeleted}}\n* {{msg-mw|grant-viewmywatchlist}}",
"grant-group-page-interaction": "{{Related|Grant-group}}",
"grant-group-file-interaction": "{{Related|Grant-group}}",
"grant-group-watchlist-interaction": "{{Related|Grant-group}}",
"grant-createaccount": "Name for grant \"createaccount\".\n{{Related|Grant}}\n{{Identical|Create account}}",
"grant-createeditmovepage": "Name for grant \"createeditmovepage\".\n{{Related|Grant}}",
"grant-delete": "Name for grant \"delete\".\n{{Related|Grant}}",
- "grant-editinterface": "Name for grant \"editinterface\".\n\n\"JS\" stands for \"JavaScript\".\n{{Related|Grant}}",
+ "grant-editinterface": "Name for grant \"editinterface\".\n{{Related|Grant}}",
"grant-editmycssjs": "Name for grant \"editmycssjs\".\n\n\"JS\" stands for \"JavaScript\".\n{{Related|Grant}}",
"grant-editmyoptions": "Name for grant \"editmyoptions\".\n{{Related|Grant}}",
"grant-editmywatchlist": "Name for grant \"editmywatchlist\".\n{{Related|Grant}}\n{{Identical|Edit your watchlist}}",
+ "grant-editsiteconfig": "Name for grant \"editsiteconfig\".\n{{Related|Grant}}",
"grant-editpage": "Name for grant \"editpage\".\n{{Related|Grant}}",
"grant-editprotected": "Name for grant \"editprotected\".\n{{Related|Grant}}",
"grant-highvolume": "Name for grant \"highvolume\".\n{{Related|Grant}}",
* @ingroup Maintenance
*/
class CreateAndPromote extends Maintenance {
- private static $permitRoles = [ 'sysop', 'bureaucrat', 'bot' ];
+ private static $permitRoles = [ 'sysop', 'bureaucrat', 'interface-admin', 'bot' ];
public function __construct() {
parent::__construct();
-- T167246. Add an `actor` table and various columns (and temporary tables) to reference it.
CREATE TABLE /*_*/actor (
- actor_id bigint unsigned NOT NULL CONSTRAINT PK_actor PRIMARY KEY IDENTITY(0,1),
- actor_user int unsigned,
+ actor_id bigint NOT NULL CONSTRAINT PK_actor PRIMARY KEY IDENTITY(0,1),
+ actor_user int,
actor_name nvarchar(255) NOT NULL
);
CREATE UNIQUE INDEX /*i*/actor_user ON /*_*/actor (actor_user);
INSERT INTO /*_*/actor (actor_name) VALUES ('##Anonymous##');
CREATE TABLE /*_*/revision_actor_temp (
- revactor_rev int unsigned NOT NULL CONSTRAINT FK_revactor_rev FOREIGN KEY REFERENCES /*_*/revision(rev_id) ON DELETE CASCADE,
- revactor_actor bigint unsigned NOT NULL,
+ revactor_rev int NOT NULL CONSTRAINT FK_revactor_rev FOREIGN KEY REFERENCES /*_*/revision(rev_id) ON DELETE CASCADE,
+ revactor_actor bigint NOT NULL,
revactor_timestamp varchar(14) NOT NULL CONSTRAINT DF_revactor_timestamp DEFAULT '',
- revactor_page int unsigned NOT NULL,
+ revactor_page int NOT NULL,
CONSTRAINT PK_revision_actor_temp PRIMARY KEY (revactor_rev, revactor_actor)
);
CREATE UNIQUE INDEX /*i*/revactor_rev ON /*_*/revision_actor_temp (revactor_rev);
CREATE INDEX /*i*/page_actor_timestamp ON /*_*/revision_actor_temp (revactor_page,revactor_actor,revactor_timestamp);
ALTER TABLE /*_*/archive ADD CONSTRAINT DF_ar_user_text DEFAULT '' FOR ar_user_text;
-ALTER TABLE /*_*/archive ADD ar_actor bigint unsigned NOT NULL CONSTRAINT DF_ar_actor DEFAULT 0;
+ALTER TABLE /*_*/archive ADD ar_actor bigint NOT NULL CONSTRAINT DF_ar_actor DEFAULT 0;
CREATE INDEX /*i*/ar_actor_timestamp ON /*_*/archive (ar_actor,ar_timestamp);
-ALTER TABLE /*_*/ipblocks ADD ipb_by_actor bigint unsigned NOT NULL CONSTRAINT DF_ipb_by_actor DEFAULT 0;
+ALTER TABLE /*_*/ipblocks ADD ipb_by_actor bigint NOT NULL CONSTRAINT DF_ipb_by_actor DEFAULT 0;
ALTER TABLE /*_*/image ADD CONSTRAINT DF_img_user_text DEFAULT '' FOR img_user_text;
-ALTER TABLE /*_*/image ADD img_actor bigint unsigned NOT NULL CONSTRAINT DF_img_actor DEFAULT 0;
+ALTER TABLE /*_*/image ADD img_actor bigint NOT NULL CONSTRAINT DF_img_actor DEFAULT 0;
CREATE INDEX /*i*/img_actor_timestamp ON /*_*/image (img_actor, img_timestamp);
ALTER TABLE /*_*/oldimage ADD CONSTRAINT DF_oi_user_text DEFAULT '' FOR oi_user_text;
-ALTER TABLE /*_*/oldimage ADD oi_actor bigint unsigned NOT NULL CONSTRAINT DF_oi_actor DEFAULT 0;
+ALTER TABLE /*_*/oldimage ADD oi_actor bigint NOT NULL CONSTRAINT DF_oi_actor DEFAULT 0;
CREATE INDEX /*i*/oi_actor_timestamp ON /*_*/oldimage (oi_actor,oi_timestamp);
ALTER TABLE /*_*/filearchive ADD CONSTRAINT DF_fa_user_text DEFAULT '' FOR fa_user_text;
-ALTER TABLE /*_*/filearchive ADD fa_actor bigint unsigned NOT NULL CONSTRAINT DF_fa_actor DEFAULT 0;
+ALTER TABLE /*_*/filearchive ADD fa_actor bigint NOT NULL CONSTRAINT DF_fa_actor DEFAULT 0;
CREATE INDEX /*i*/fa_actor_timestamp ON /*_*/filearchive (fa_actor,fa_timestamp);
ALTER TABLE /*_*/recentchanges ADD CONSTRAINT DF_rc_user_text DEFAULT '' FOR rc_user_text;
-ALTER TABLE /*_*/recentchanges ADD rc_actor bigint unsigned NOT NULL CONSTRAINT DF_rc_actor DEFAULT 0;
+ALTER TABLE /*_*/recentchanges ADD rc_actor bigint NOT NULL CONSTRAINT DF_rc_actor DEFAULT 0;
CREATE INDEX /*i*/rc_ns_actor ON /*_*/recentchanges (rc_namespace, rc_actor);
CREATE INDEX /*i*/rc_actor ON /*_*/recentchanges (rc_actor, rc_timestamp);
-ALTER TABLE /*_*/logging ADD log_actor bigint unsigned NOT NULL CONSTRAINT DF_log_actor DEFAULT 0;
+ALTER TABLE /*_*/logging ADD log_actor bigint NOT NULL CONSTRAINT DF_log_actor DEFAULT 0;
CREATE INDEX /*i*/actor_time ON /*_*/logging (log_actor, log_timestamp);
CREATE INDEX /*i*/log_actor_type_time ON /*_*/logging (log_actor, log_type, log_timestamp);
-- T166732. Add a `comment` table and various columns (and temporary tables) to reference it.
CREATE TABLE /*_*/comment (
- comment_id bigint unsigned NOT NULL PRIMARY KEY IDENTITY(0,1),
+ comment_id bigint NOT NULL PRIMARY KEY IDENTITY(0,1),
comment_hash INT NOT NULL,
comment_text nvarchar(max) NOT NULL,
comment_data nvarchar(max)
CREATE TABLE /*_*/revision_comment_temp (
revcomment_rev INT NOT NULL CONSTRAINT FK_revcomment_rev FOREIGN KEY REFERENCES /*_*/revision(rev_id) ON DELETE CASCADE,
- revcomment_comment_id bigint unsigned NOT NULL CONSTRAINT FK_revcomment_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ revcomment_comment_id bigint NOT NULL CONSTRAINT FK_revcomment_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
CONSTRAINT PK_revision_comment_temp PRIMARY KEY (revcomment_rev, revcomment_comment_id)
);
CREATE UNIQUE INDEX /*i*/revcomment_rev ON /*_*/revision_comment_temp (revcomment_rev);
CREATE TABLE /*_*/image_comment_temp (
- imgcomment_name nvarchar(255) NOT NULL CONSTRAINT FK_imgcomment_name FOREIGN KEY REFERENCES /*_*/image(imgcomment_name) ON DELETE CASCADE,
- imgcomment_description_id bigint unsigned NOT NULL CONSTRAINT FK_imgcomment_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ imgcomment_name nvarchar(255) NOT NULL CONSTRAINT FK_imgcomment_name FOREIGN KEY REFERENCES /*_*/image(img_name) ON DELETE CASCADE,
+ imgcomment_description_id bigint NOT NULL CONSTRAINT FK_imgcomment_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
CONSTRAINT PK_image_comment_temp PRIMARY KEY (imgcomment_name, imgcomment_description_id)
);
CREATE UNIQUE INDEX /*i*/imgcomment_name ON /*_*/image_comment_temp (imgcomment_name);
ALTER TABLE /*_*/revision ADD CONSTRAINT DF_rev_comment DEFAULT '' FOR rev_comment;
ALTER TABLE /*_*/archive ADD CONSTRAINT DF_ar_comment DEFAULT '' FOR ar_comment;
-ALTER TABLE /*_*/archive ADD ar_comment_id bigint unsigned NOT NULL CONSTRAINT DF_ar_comment_id DEFAULT 0 CONSTRAINT FK_ar_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/archive ADD ar_comment_id bigint NOT NULL CONSTRAINT DF_ar_comment_id DEFAULT 0 CONSTRAINT FK_ar_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
ALTER TABLE /*_*/ipblocks ADD CONSTRAINT DF_ipb_reason DEFAULT '' FOR ipb_reason;
-ALTER TABLE /*_*/ipblocks ADD ipb_reason_id bigint unsigned NOT NULL CONSTRAINT DF_ipb_reason_id DEFAULT 0 CONSTRAINT FK_ipb_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/ipblocks ADD ipb_reason_id bigint NOT NULL CONSTRAINT DF_ipb_reason_id DEFAULT 0 CONSTRAINT FK_ipb_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
ALTER TABLE /*_*/image ADD CONSTRAINT DF_img_description DEFAULT '' FOR img_description;
ALTER TABLE /*_*/oldimage ADD CONSTRAINT DF_oi_description DEFAULT '' FOR oi_description;
-ALTER TABLE /*_*/oldimage ADD oi_description_id bigint unsigned NOT NULL CONSTRAINT DF_oi_description_id DEFAULT 0 CONSTRAINT FK_oi_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/oldimage ADD oi_description_id bigint NOT NULL CONSTRAINT DF_oi_description_id DEFAULT 0 CONSTRAINT FK_oi_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
ALTER TABLE /*_*/filearchive ADD CONSTRAINT DF_fa_deleted_reason DEFAULT '' FOR fa_deleted_reason;
-ALTER TABLE /*_*/filearchive ADD fa_deleted_reason_id bigint unsigned NOT NULL CONSTRAINT DF_fa_deleted_reason_id DEFAULT 0 CONSTRAINT FK_fa_deleted_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/filearchive ADD fa_deleted_reason_id bigint NOT NULL CONSTRAINT DF_fa_deleted_reason_id DEFAULT 0 CONSTRAINT FK_fa_deleted_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
ALTER TABLE /*_*/filearchive ADD CONSTRAINT DF_fa_description DEFAULT '' FOR fa_description;
-ALTER TABLE /*_*/filearchive ADD fa_description_id bigint unsigned NOT NULL CONSTRAINT DF_fa_description_id DEFAULT 0 CONSTRAINT FK_fa_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/filearchive ADD fa_description_id bigint NOT NULL CONSTRAINT DF_fa_description_id DEFAULT 0 CONSTRAINT FK_fa_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
-ALTER TABLE /*_*/recentchanges ADD rc_comment_id bigint unsigned NOT NULL CONSTRAINT DF_rc_comment_id DEFAULT 0 CONSTRAINT FK_rc_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/recentchanges ADD rc_comment_id bigint NOT NULL CONSTRAINT DF_rc_comment_id DEFAULT 0 CONSTRAINT FK_rc_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
-ALTER TABLE /*_*/logging ADD log_comment_id bigint unsigned NOT NULL CONSTRAINT DF_log_comment_id DEFAULT 0 CONSTRAINT FK_log_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/logging ADD log_comment_id bigint NOT NULL CONSTRAINT DF_log_comment_id DEFAULT 0 CONSTRAINT FK_log_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
ALTER TABLE /*_*/protected_titles ADD CONSTRAINT DF_pt_reason DEFAULT '' FOR pt_reason;
-ALTER TABLE /*_*/protected_titles ADD pt_reason_id bigint unsigned NOT NULL CONSTRAINT DF_pt_reason_id DEFAULT 0 CONSTRAINT FK_pt_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
+ALTER TABLE /*_*/protected_titles ADD pt_reason_id bigint NOT NULL CONSTRAINT DF_pt_reason_id DEFAULT 0 CONSTRAINT FK_pt_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id);
CREATE TABLE /*_*/content (
-- ID of the content object
- content_id bigint unsigned NOT NULL CONSTRAINT PK_content PRIMARY KEY IDENTITY,
+ content_id bigint NOT NULL CONSTRAINT PK_content PRIMARY KEY IDENTITY,
-- Nominal size of the content object (not necessarily of the serialized blob)
- content_size int unsigned NOT NULL,
+ content_size int NOT NULL,
-- Nominal hash of the content object (not necessarily of the serialized blob)
content_sha1 varchar(32) NOT NULL,
-- reference to model_id
- content_model smallint unsigned NOT NULL CONSTRAINT FK_content_content_models FOREIGN KEY REFERENCES /*_*/content_models(model_id),
+ content_model smallint NOT NULL CONSTRAINT FK_content_content_models FOREIGN KEY REFERENCES /*_*/content_models(model_id),
-- URL-like address of the content blob
content_address nvarchar(255) NOT NULL
-);
\ No newline at end of file
+);
CREATE TABLE /*_*/slots (
-- reference to rev_id
- slot_revision_id bigint unsigned NOT NULL,
+ slot_revision_id bigint NOT NULL,
-- reference to role_id
- slot_role_id smallint unsigned NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id),
+ slot_role_id smallint NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id),
-- reference to content_id
- slot_content_id bigint unsigned NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id),
+ slot_content_id bigint NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id),
-- The revision ID of the revision that originated the slot's content.
-- To find revisions that changed slots, look for slot_origin = slot_revision_id.
- slot_origin bigint unsigned NOT NULL,
+ slot_origin bigint NOT NULL,
CONSTRAINT PK_slots PRIMARY KEY (slot_revision_id, slot_role_id)
);
-- can refer to the user table directly.
--
CREATE TABLE /*_*/actor (
- actor_id bigint unsigned NOT NULL CONSTRAINT PK_actor PRIMARY KEY IDENTITY(0,1),
- actor_user int unsigned,
+ actor_id bigint NOT NULL CONSTRAINT PK_actor PRIMARY KEY IDENTITY(0,1),
+ actor_user int,
actor_name nvarchar(255) NOT NULL
);
CREATE UNIQUE INDEX /*i*/actor_user ON /*_*/actor (actor_user);
-- the same comment_text and comment_data.
--
CREATE TABLE /*_*/comment (
- comment_id bigint unsigned NOT NULL PRIMARY KEY IDENTITY(0,1),
+ comment_id bigint NOT NULL PRIMARY KEY IDENTITY(0,1),
comment_hash INT NOT NULL,
comment_text nvarchar(max) NOT NULL,
comment_data nvarchar(max)
--
CREATE TABLE /*_*/revision_comment_temp (
revcomment_rev INT NOT NULL CONSTRAINT FK_revcomment_rev FOREIGN KEY REFERENCES /*_*/revision(rev_id) ON DELETE CASCADE,
- revcomment_comment_id bigint unsigned NOT NULL CONSTRAINT FK_revcomment_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ revcomment_comment_id bigint NOT NULL CONSTRAINT FK_revcomment_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
CONSTRAINT PK_revision_comment_temp PRIMARY KEY (revcomment_rev, revcomment_comment_id)
);
CREATE UNIQUE INDEX /*i*/revcomment_rev ON /*_*/revision_comment_temp (revcomment_rev);
CREATE TABLE /*_*/revision_actor_temp (
- revactor_rev int unsigned NOT NULL CONSTRAINT FK_revactor_rev FOREIGN KEY REFERENCES /*_*/revision(rev_id) ON DELETE CASCADE,
- revactor_actor bigint unsigned NOT NULL,
+ revactor_rev int NOT NULL CONSTRAINT FK_revactor_rev FOREIGN KEY REFERENCES /*_*/revision(rev_id) ON DELETE CASCADE,
+ revactor_actor bigint NOT NULL,
revactor_timestamp varchar(14) NOT NULL CONSTRAINT DF_revactor_timestamp DEFAULT '',
- revactor_page int unsigned NOT NULL,
+ revactor_page int NOT NULL,
CONSTRAINT PK_revision_actor_temp PRIMARY KEY (revactor_rev, revactor_actor)
);
CREATE UNIQUE INDEX /*i*/revactor_rev ON /*_*/revision_actor_temp (revactor_rev);
ar_namespace SMALLINT NOT NULL DEFAULT 0,
ar_title NVARCHAR(255) NOT NULL DEFAULT '',
ar_comment NVARCHAR(255) NOT NULL CONSTRAINT DF_ar_comment DEFAULT '',
- ar_comment_id bigint unsigned NOT NULL CONSTRAINT DF_ar_comment_id DEFAULT 0 CONSTRAINT FK_ar_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ ar_comment_id bigint NOT NULL CONSTRAINT DF_ar_comment_id DEFAULT 0 CONSTRAINT FK_ar_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
ar_user INT CONSTRAINT ar_user__user_id__fk FOREIGN KEY REFERENCES /*_*/mwuser(user_id),
ar_user_text NVARCHAR(255) NOT NULL CONSTRAINT DF_ar_user_text DEFAULT '',
- ar_actor bigint unsigned NOT NULL CONSTRAINT DF_ar_actor DEFAULT 0,
+ ar_actor bigint NOT NULL CONSTRAINT DF_ar_actor DEFAULT 0,
ar_timestamp varchar(14) NOT NULL default '',
ar_minor_edit BIT NOT NULL DEFAULT 0,
ar_rev_id INT NOT NULL, -- NOT a FK, the row gets deleted from revision and moved here
--
--- Slots represent an n:m relation between revisions and content objects.
--- A content object can have a specific "role" in one or more revisions.
--- Each revision can have multiple content objects, each having a different role.
+-- Normalization table for role names
--
-CREATE TABLE /*_*/slots (
-
- -- reference to rev_id
- slot_revision_id bigint unsigned NOT NULL,
-
- -- reference to role_id
- slot_role_id smallint unsigned NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id),
-
- -- reference to content_id
- slot_content_id bigint unsigned NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id),
+CREATE TABLE /*_*/slot_roles (
+ role_id smallint NOT NULL CONSTRAINT PK_slot_roles PRIMARY KEY IDENTITY,
+ role_name nvarchar(64) NOT NULL
+);
- -- The revision ID of the revision that originated the slot's content.
- -- To find revisions that changed slots, look for slot_origin = slot_revision_id.
- slot_origin bigint NOT NULL,
+-- Index for looking of the internal ID of for a name
+CREATE UNIQUE INDEX /*i*/role_name ON /*_*/slot_roles (role_name);
- CONSTRAINT PK_slots PRIMARY KEY (slot_revision_id, slot_role_id)
+--
+-- Normalization table for content model names
+--
+CREATE TABLE /*_*/content_models (
+ model_id smallint NOT NULL CONSTRAINT PK_content_models PRIMARY KEY IDENTITY,
+ model_name nvarchar(64) NOT NULL
);
--- Index for finding revisions that modified a specific slot
-CREATE INDEX /*i*/slot_revision_origin_role ON /*_*/slots (slot_revision_id, slot_origin, slot_role_id);
+-- Index for looking of the internal ID of for a name
+CREATE UNIQUE INDEX /*i*/model_name ON /*_*/content_models (model_name);
--
-- The content table represents content objects. It's primary purpose is to provide the necessary
CREATE TABLE /*_*/content (
-- ID of the content object
- content_id bigint unsigned NOT NULL CONSTRAINT PK_content PRIMARY KEY IDENTITY,
+ content_id bigint NOT NULL CONSTRAINT PK_content PRIMARY KEY IDENTITY,
-- Nominal size of the content object (not necessarily of the serialized blob)
- content_size int unsigned NOT NULL,
+ content_size int NOT NULL,
-- Nominal hash of the content object (not necessarily of the serialized blob)
content_sha1 varchar(32) NOT NULL,
-- reference to model_id
- content_model smallint unsigned NOT NULL CONSTRAINT FK_content_content_models FOREIGN KEY REFERENCES /*_*/content_models(model_id),
+ content_model smallint NOT NULL CONSTRAINT FK_content_content_models FOREIGN KEY REFERENCES /*_*/content_models(model_id),
-- URL-like address of the content blob
content_address nvarchar(255) NOT NULL
);
--
--- Normalization table for role names
+-- Slots represent an n:m relation between revisions and content objects.
+-- A content object can have a specific "role" in one or more revisions.
+-- Each revision can have multiple content objects, each having a different role.
--
-CREATE TABLE /*_*/slot_roles (
- role_id smallint NOT NULL CONSTRAINT PK_slot_roles PRIMARY KEY IDENTITY,
- role_name nvarchar(64) NOT NULL
-);
+CREATE TABLE /*_*/slots (
--- Index for looking of the internal ID of for a name
-CREATE UNIQUE INDEX /*i*/role_name ON /*_*/slot_roles (role_name);
+ -- reference to rev_id
+ slot_revision_id bigint NOT NULL,
---
--- Normalization table for content model names
---
-CREATE TABLE /*_*/content_models (
- model_id smallint NOT NULL CONSTRAINT PK_content_models PRIMARY KEY IDENTITY,
- model_name nvarchar(64) NOT NULL
+ -- reference to role_id
+ slot_role_id smallint NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id),
+
+ -- reference to content_id
+ slot_content_id bigint NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id),
+
+ -- The revision ID of the revision that originated the slot's content.
+ -- To find revisions that changed slots, look for slot_origin = slot_revision_id.
+ slot_origin bigint NOT NULL,
+
+ CONSTRAINT PK_slots PRIMARY KEY (slot_revision_id, slot_role_id)
);
--- Index for looking of the internal ID of for a name
-CREATE UNIQUE INDEX /*i*/model_name ON /*_*/content_models (model_name);
+-- Index for finding revisions that modified a specific slot
+CREATE INDEX /*i*/slot_revision_origin_role ON /*_*/slots (slot_revision_id, slot_origin, slot_role_id);
--
ipb_by int REFERENCES /*_*/mwuser(user_id) ON DELETE CASCADE,
-- Actor ID who made the block.
- ipb_by_actor bigint unsigned NOT NULL CONSTRAINT DF_ipb_by_actor DEFAULT 0,
+ ipb_by_actor bigint NOT NULL CONSTRAINT DF_ipb_by_actor DEFAULT 0,
-- User name of blocker
ipb_by_text nvarchar(255) NOT NULL default '',
-- Key to comment_id. Text comment made by blocker.
-- ("DEFAULT 0" is temporary, signaling that ipb_reason should be used)
- ipb_reason_id bigint unsigned NOT NULL CONSTRAINT DF_ipb_reason_id DEFAULT 0 CONSTRAINT FK_ipb_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ ipb_reason_id bigint NOT NULL CONSTRAINT DF_ipb_reason_id DEFAULT 0 CONSTRAINT FK_ipb_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
-- Creation (or refresh) date in standard YMDHMS form.
-- IP blocks expire automatically.
-- user_id and user_name of uploader.
img_user int REFERENCES /*_*/mwuser(user_id) ON DELETE SET NULL,
img_user_text nvarchar(255) NOT NULL CONSTRAINT DF_img_user_text DEFAULT '',
- img_actor bigint unsigned NOT NULL CONSTRAINT DF_img_actor DEFAULT 0,
+ img_actor bigint NOT NULL CONSTRAINT DF_img_actor DEFAULT 0,
-- Time of the upload.
img_timestamp nvarchar(14) NOT NULL default '',
-- will be merged back into image in the future.
--
CREATE TABLE /*_*/image_comment_temp (
- imgcomment_name nvarchar(255) NOT NULL CONSTRAINT FK_imgcomment_name FOREIGN KEY REFERENCES /*_*/image(imgcomment_name) ON DELETE CASCADE,
- imgcomment_description_id bigint unsigned NOT NULL CONSTRAINT FK_imgcomment_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ imgcomment_name nvarchar(255) NOT NULL CONSTRAINT FK_imgcomment_name FOREIGN KEY REFERENCES /*_*/image(img_name) ON DELETE CASCADE,
+ imgcomment_description_id bigint NOT NULL CONSTRAINT FK_imgcomment_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
CONSTRAINT PK_image_comment_temp PRIMARY KEY (imgcomment_name, imgcomment_description_id)
);
CREATE UNIQUE INDEX /*i*/imgcomment_name ON /*_*/image_comment_temp (imgcomment_name);
oi_height int NOT NULL default 0,
oi_bits int NOT NULL default 0,
oi_description nvarchar(255) NOT NULL CONSTRAINT DF_oi_description DEFAULT '',
- oi_description_id bigint unsigned NOT NULL CONSTRAINT DF_oi_description_id DEFAULT 0 CONSTRAINT FK_oi_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ oi_description_id bigint NOT NULL CONSTRAINT DF_oi_description_id DEFAULT 0 CONSTRAINT FK_oi_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
oi_user int REFERENCES /*_*/mwuser(user_id),
oi_user_text nvarchar(255) NOT NULL CONSTRAINT DF_oi_user_text DEFAULT '',
- oi_actor bigint unsigned NOT NULL CONSTRAINT DF_oi_actor DEFAULT 0,
+ oi_actor bigint NOT NULL CONSTRAINT DF_oi_actor DEFAULT 0,
oi_timestamp varchar(14) NOT NULL default '',
oi_metadata varbinary(max) NOT NULL,
fa_deleted_user int,
fa_deleted_timestamp varchar(14) default '',
fa_deleted_reason nvarchar(max) CONSTRAINT DF_fa_deleted_reason DEFAULT '',
- fa_deleted_reason_id bigint unsigned NOT NULL CONSTRAINT DF_fa_deleted_reason_id DEFAULT 0 CONSTRAINT FK_fa_deleted_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ fa_deleted_reason_id bigint NOT NULL CONSTRAINT DF_fa_deleted_reason_id DEFAULT 0 CONSTRAINT FK_fa_deleted_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
-- Duped fields from image
fa_size int default 0,
fa_major_mime varchar(16) not null default 'unknown',
fa_minor_mime nvarchar(100) default 'unknown',
fa_description nvarchar(255) CONSTRAINT DF_fa_description DEFAULT '',
- fa_description_id bigint unsigned NOT NULL CONSTRAINT DF_fa_description DEFAULT 0 CONSTRAINT FK_fa_description FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ fa_description_id bigint NOT NULL CONSTRAINT DF_fa_description_id DEFAULT 0 CONSTRAINT FK_fa_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
fa_user int default 0 REFERENCES /*_*/mwuser(user_id) ON DELETE SET NULL,
fa_user_text nvarchar(255) CONSTRAINT DF_fa_user_text DEFAULT '',
- fa_actor bigint unsigned NOT NULL CONSTRAINT DF_fa_actor DEFAULT 0,
+ fa_actor bigint NOT NULL CONSTRAINT DF_fa_actor DEFAULT 0,
fa_timestamp varchar(14) default '',
-- Visibility of deleted revisions, bitfield
-- As in revision
rc_user int NOT NULL default 0 CONSTRAINT rc_user__user_id__fk FOREIGN KEY REFERENCES /*_*/mwuser(user_id),
rc_user_text nvarchar(255) NOT NULL CONSTRAINT DF_rc_user_text DEFAULT '',
- rc_actor bigint unsigned NOT NULL CONSTRAINT DF_rc_actor DEFAULT 0,
+ rc_actor bigint NOT NULL CONSTRAINT DF_rc_actor DEFAULT 0,
-- When pages are renamed, their RC entries do _not_ change.
rc_namespace int NOT NULL default 0,
-- as in revision...
rc_comment nvarchar(255) NOT NULL default '',
- rc_comment_id bigint unsigned NOT NULL CONSTRAINT DF_rc_comment_id DEFAULT 0 CONSTRAINT FK_rc_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ rc_comment_id bigint NOT NULL CONSTRAINT DF_rc_comment_id DEFAULT 0 CONSTRAINT FK_rc_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
rc_minor bit NOT NULL default 0,
-- Edits by user accounts with the 'bot' rights key are
log_user_text nvarchar(255) NOT NULL default '',
-- The actor who performed this action
- log_actor bigint unsigned NOT NULL CONSTRAINT DF_log_actor DEFAULT 0,
+ log_actor bigint NOT NULL CONSTRAINT DF_log_actor DEFAULT 0,
-- Key to the page affected. Where a user is the target,
-- this will point to the user page.
-- Key to comment_id. Comment summarizing the change.
-- ("DEFAULT 0" is temporary, signaling that log_comment should be used)
- log_comment_id bigint unsigned NOT NULL CONSTRAINT DF_log_comment_id DEFAULT 0 CONSTRAINT FK_log_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ log_comment_id bigint NOT NULL CONSTRAINT DF_log_comment_id DEFAULT 0 CONSTRAINT FK_log_comment_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
-- miscellaneous parameters:
-- LF separated list (old system) or serialized PHP array (new system)
pt_title nvarchar(255) NOT NULL,
pt_user int REFERENCES /*_*/mwuser(user_id) ON DELETE SET NULL,
pt_reason nvarchar(255) CONSTRAINT DF_pt_reason DEFAULT '',
- pt_reason_id bigint unsigned NOT NULL CONSTRAINT DF_pt_reason_id DEFAULT 0 CONSTRAINT FK_pt_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
+ pt_reason_id bigint NOT NULL CONSTRAINT DF_pt_reason_id DEFAULT 0 CONSTRAINT FK_pt_reason_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
pt_timestamp varchar(14) NOT NULL,
pt_expiry varchar(14) NOT NULL,
pt_create_perm nvarchar(60) NOT NULL,
CREATE INDEX &mw_prefix.actor_timestamp ON &mw_prefix.revision_actor_temp (revactor_actor,revactor_timestamp);
CREATE INDEX &mw_prefix.page_actor_timestamp ON &mw_prefix.revision_actor_temp (revactor_page,revactor_actor,revactor_timestamp);
-ALTER TABLE &mw_prefix.archive ALTER COLUMN ar_user_text VARCHAR2(255) NULL;
-ALTER TABLE &mw_prefix.archive ADD COLUMN ar_actor NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.archive MODIFY ( ar_user_text NULL );
+ALTER TABLE &mw_prefix.archive ADD ( ar_actor NUMBER DEFAULT 0 NOT NULL );
CREATE INDEX &mw_prefix.ar_actor_timestamp ON &mw_prefix.archive (ar_actor,ar_timestamp);
-ALTER TABLE &mw_prefix.ipblocks ADD COLUMN ipb_by_actor NUMBER DEFUALT 0 NOT NULL;
+ALTER TABLE &mw_prefix.ipblocks ADD ( ipb_by_actor NUMBER DEFAULT 0 NOT NULL );
-ALTER TABLE &mw_prefix.image ALTER COLUMN img_user_text VARCHAR2(255) NULL;
-ALTER TABLE &mw_prefix.image ADD COLUMN img_actor NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.image MODIFY ( img_user_text NULL );
+ALTER TABLE &mw_prefix.image ADD ( img_actor NUMBER DEFAULT 0 NOT NULL );
CREATE INDEX &mw_prefix.img_actor_timestamp ON &mw_prefix.image (img_actor, img_timestamp);
-ALTER TABLE &mw_prefix.oldimage ALTER COLUMN oi_user_text VARCHAR2(255) NULL;
-ALTER TABLE &mw_prefix.oldimage ADD COLUMN oi_actor NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.oldimage MODIFY ( oi_user_text NULL );
+ALTER TABLE &mw_prefix.oldimage ADD ( oi_actor NUMBER DEFAULT 0 NOT NULL );
CREATE INDEX &mw_prefix.oi_actor_timestamp ON &mw_prefix.oldimage (oi_actor,oi_timestamp);
-ALTER TABLE &mw_prefix.filearchive ALTER COLUMN fa_user_text VARCHAR2(255) NULL;
-ALTER TABLE &mw_prefix.filearchive ADD COLUMN fa_actor NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.filearchive MODIFY ( fa_user_text NULL );
+ALTER TABLE &mw_prefix.filearchive ADD ( fa_actor NUMBER DEFAULT 0 NOT NULL );
CREATE INDEX &mw_prefix.fa_actor_timestamp ON &mw_prefix.filearchive (fa_actor,fa_timestamp);
-ALTER TABLE &mw_prefix.recentchanges ALTER COLUMN rc_user_text VARCHAR2(255) NULL;
-ALTER TABLE &mw_prefix.recentchanges ADD COLUMN rc_actor NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.recentchanges MODIFY ( rc_user_text NULL );
+ALTER TABLE &mw_prefix.recentchanges ADD ( rc_actor NUMBER DEFAULT 0 NOT NULL );
CREATE INDEX &mw_prefix.rc_ns_actor ON &mw_prefix.recentchanges (rc_namespace, rc_actor);
CREATE INDEX &mw_prefix.rc_actor ON &mw_prefix.recentchanges (rc_actor, rc_timestamp);
-ALTER TABLE &mw_prefix.logging ADD COLUMN log_actor NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.logging ADD ( log_actor NUMBER DEFAULT 0 NOT NULL );
CREATE INDEX &mw_prefix.actor_time ON &mw_prefix.logging (log_actor, log_timestamp);
CREATE INDEX &mw_prefix.log_actor_type_time ON &mw_prefix.logging (log_actor, log_type, log_timestamp);
CREATE UNIQUE INDEX &mw_prefix.imgcomment_name ON &mw_prefix.image_comment_temp (imgcomment_name);
-ALTER TABLE &mw_prefix.archive ADD COLUMN ar_comment_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.archive ADD ( ar_comment_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.archive ADD CONSTRAINT &mw_prefix.archive_fk2 FOREIGN KEY (ar_comment_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.ipblocks ALTER COLUMN ipb_reason VARCHAR2(255) NULL;
-ALTER TABLE &mw_prefix.ipblocks ADD COLUMN ipb_reason_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.ipblocks MODIFY ( ipb_reason NULL );
+ALTER TABLE &mw_prefix.ipblocks ADD ( ipb_reason_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.ipblocks ADD CONSTRAINT &mw_prefix.ipblocks_fk3 FOREIGN KEY (ipb_reason_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.oldimage ADD COLUMN oi_description_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.oldimage ADD ( oi_description_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.oldimage ADD CONSTRAINT &mw_prefix.oldimage_fk3 FOREIGN KEY (oi_description_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.filearchive ADD COLUMN fa_deleted_reason_id NUMBER DEFAULT 0 NOT NULL;
-ALTER TABLE &mw_prefix.filearchive ADD COLUMN fa_description_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.filearchive ADD ( fa_deleted_reason_id NUMBER DEFAULT 0 NOT NULL );
+ALTER TABLE &mw_prefix.filearchive ADD ( fa_description_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.filearchive ADD CONSTRAINT &mw_prefix.filearchive_fk3 FOREIGN KEY (fa_deleted_reason_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE &mw_prefix.filearchive ADD CONSTRAINT &mw_prefix.filearchive_fk4 FOREIGN KEY (fa_description_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.recentchanges ADD COLUMN rc_comment_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.recentchanges ADD ( rc_comment_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.recentchanges ADD CONSTRAINT &mw_prefix.recentchanges_fk3 FOREIGN KEY (rc_comment_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.logging ADD COLUMN log_comment_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.logging ADD ( log_comment_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.logging ADD CONSTRAINT &mw_prefix.logging_fk2 FOREIGN KEY (log_comment_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.protected_titles ADD COLUMN pt_reason_id NUMBER DEFAULT 0 NOT NULL;
+ALTER TABLE &mw_prefix.protected_titles ADD ( pt_reason_id NUMBER DEFAULT 0 NOT NULL );
ALTER TABLE &mw_prefix.protected_titles ADD CONSTRAINT &mw_prefix.protected_titles_fk1 FOREIGN KEY (pt_reason_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
ipb_user NUMBER DEFAULT 0 NOT NULL,
ipb_by NUMBER DEFAULT 0 NOT NULL,
ipb_by_text VARCHAR2(255) NULL,
- ipb_by_actor NUMBER DEFUALT 0 NOT NULL,
+ ipb_by_actor NUMBER DEFAULT 0 NOT NULL,
ipb_reason VARCHAR2(255) NULL,
ipb_reason_id NUMBER DEFAULT 0 NOT NULL,
ipb_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
* For best performance, call this once only for all tests. However, it can
* be called at the start of each test if more isolation is desired.
*
- * @todo: This is basically an unrefactored copy of
+ * @todo This is basically an unrefactored copy of
* MediaWikiTestCase::setupAllTestDBs. They should be factored out somehow.
*
* Do not call this function from a MediaWikiTestCase subclass, since
--- /dev/null
+<?php
+/**
+ * @group GlobalFunctions
+ * @covers ::wfExpandUrl
+ */
+class WfExpandUrlTest extends MediaWikiTestCase {
+ /**
+ * @dataProvider provideExpandableUrls
+ */
+ public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto,
+ $server, $canServer, $httpsMode, $httpsPort, $message
+ ) {
+ // Fake $wgServer, $wgCanonicalServer and $wgRequest->getProtocol()
+ // fake edit to fake globals
+ $this->setMwGlobals( [
+ 'wgServer' => $server,
+ 'wgCanonicalServer' => $canServer,
+ 'wgRequest' => new FauxRequest( [], false, null, $httpsMode ? 'https' : 'http' ),
+ 'wgHttpsPort' => $httpsPort
+ ] );
+
+ $this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message );
+ }
+
+ /**
+ * Provider of URL examples for testing wfExpandUrl()
+ *
+ * @return array
+ */
+ public static function provideExpandableUrls() {
+ $modes = [ 'http', 'https' ];
+ $servers = [
+ 'http' => 'http://example.com',
+ 'https' => 'https://example.com',
+ 'protocol-relative' => '//example.com'
+ ];
+ $defaultProtos = [
+ 'http' => PROTO_HTTP,
+ 'https' => PROTO_HTTPS,
+ 'protocol-relative' => PROTO_RELATIVE,
+ 'current' => PROTO_CURRENT,
+ 'canonical' => PROTO_CANONICAL
+ ];
+
+ $retval = [];
+ foreach ( $modes as $mode ) {
+ $httpsMode = $mode == 'https';
+ foreach ( $servers as $serverDesc => $server ) {
+ foreach ( $modes as $canServerMode ) {
+ $canServer = "$canServerMode://example2.com";
+ foreach ( $defaultProtos as $protoDesc => $defaultProto ) {
+ $retval[] = [
+ 'http://example.com', 'http://example.com',
+ $defaultProto, $server, $canServer, $httpsMode, 443,
+ "Testing fully qualified http URLs (no need to expand) "
+ . "(defaultProto: $protoDesc , wgServer: $server, "
+ . "wgCanonicalServer: $canServer, current request protocol: $mode )"
+ ];
+ $retval[] = [
+ 'https://example.com', 'https://example.com',
+ $defaultProto, $server, $canServer, $httpsMode, 443,
+ "Testing fully qualified https URLs (no need to expand) "
+ . "(defaultProto: $protoDesc , wgServer: $server, "
+ . "wgCanonicalServer: $canServer, current request protocol: $mode )"
+ ];
+ # Would be nice to support this, see fixme on wfExpandUrl()
+ $retval[] = [
+ "wiki/FooBar", 'wiki/FooBar',
+ $defaultProto, $server, $canServer, $httpsMode, 443,
+ "Test non-expandable relative URLs (defaultProto: $protoDesc, "
+ . "wgServer: $server, wgCanonicalServer: $canServer, "
+ . "current request protocol: $mode )"
+ ];
+
+ // Determine expected protocol
+ if ( $protoDesc == 'protocol-relative' ) {
+ $p = '';
+ } elseif ( $protoDesc == 'current' ) {
+ $p = "$mode:";
+ } elseif ( $protoDesc == 'canonical' ) {
+ $p = "$canServerMode:";
+ } else {
+ $p = $protoDesc . ':';
+ }
+ // Determine expected server name
+ if ( $protoDesc == 'canonical' ) {
+ $srv = $canServer;
+ } elseif ( $serverDesc == 'protocol-relative' ) {
+ $srv = $p . $server;
+ } else {
+ $srv = $server;
+ }
+
+ $retval[] = [
+ "$p//wikipedia.org", '//wikipedia.org',
+ $defaultProto, $server, $canServer, $httpsMode, 443,
+ "Test protocol-relative URL (defaultProto: $protoDesc, "
+ . "wgServer: $server, wgCanonicalServer: $canServer, "
+ . "current request protocol: $mode )"
+ ];
+ $retval[] = [
+ "$srv/wiki/FooBar",
+ '/wiki/FooBar',
+ $defaultProto,
+ $server,
+ $canServer,
+ $httpsMode,
+ 443,
+ "Testing expanding URL beginning with / (defaultProto: $protoDesc, "
+ . "wgServer: $server, wgCanonicalServer: $canServer, "
+ . "current request protocol: $mode )"
+ ];
+ }
+ }
+ }
+ }
+
+ // Don't add HTTPS port to foreign URLs
+ $retval[] = [
+ 'https://foreign.example.com/foo',
+ 'https://foreign.example.com/foo',
+ PROTO_HTTPS,
+ '//wiki.example.com',
+ 'http://wiki.example.com',
+ 'https',
+ 111,
+ "Don't add HTTPS port to foreign URLs"
+ ];
+ $retval[] = [
+ 'https://foreign.example.com:222/foo',
+ 'https://foreign.example.com:222/foo',
+ PROTO_HTTPS,
+ '//wiki.example.com',
+ 'http://wiki.example.com',
+ 'https',
+ 111,
+ "Don't overwrite HTTPS port of foreign URLs"
+ ];
+ // Do add HTTPS port to local URLs
+ $retval[] = [
+ 'https://wiki.example.com:111/foo',
+ '/foo',
+ PROTO_HTTPS,
+ '//wiki.example.com',
+ 'http://wiki.example.com',
+ 'https',
+ 111,
+ "Do add HTTPS port to protocol-relative URLs"
+ ];
+
+ return $retval;
+ }
+}
+++ /dev/null
-<?php
-/**
- * @group GlobalFunctions
- * @covers ::wfExpandUrl
- */
-class WfExpandUrlTest extends MediaWikiTestCase {
- /**
- * @dataProvider provideExpandableUrls
- */
- public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto,
- $server, $canServer, $httpsMode, $httpsPort, $message
- ) {
- // Fake $wgServer, $wgCanonicalServer and $wgRequest->getProtocol()
- $this->setMwGlobals( [
- 'wgServer' => $server,
- 'wgCanonicalServer' => $canServer,
- 'wgRequest' => new FauxRequest( [], false, null, $httpsMode ? 'https' : 'http' ),
- 'wgHttpsPort' => $httpsPort
- ] );
-
- $this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message );
- }
-
- /**
- * Provider of URL examples for testing wfExpandUrl()
- *
- * @return array
- */
- public static function provideExpandableUrls() {
- $modes = [ 'http', 'https' ];
- $servers = [
- 'http' => 'http://example.com',
- 'https' => 'https://example.com',
- 'protocol-relative' => '//example.com'
- ];
- $defaultProtos = [
- 'http' => PROTO_HTTP,
- 'https' => PROTO_HTTPS,
- 'protocol-relative' => PROTO_RELATIVE,
- 'current' => PROTO_CURRENT,
- 'canonical' => PROTO_CANONICAL
- ];
-
- $retval = [];
- foreach ( $modes as $mode ) {
- $httpsMode = $mode == 'https';
- foreach ( $servers as $serverDesc => $server ) {
- foreach ( $modes as $canServerMode ) {
- $canServer = "$canServerMode://example2.com";
- foreach ( $defaultProtos as $protoDesc => $defaultProto ) {
- $retval[] = [
- 'http://example.com', 'http://example.com',
- $defaultProto, $server, $canServer, $httpsMode, 443,
- "Testing fully qualified http URLs (no need to expand) "
- . "(defaultProto: $protoDesc , wgServer: $server, "
- . "wgCanonicalServer: $canServer, current request protocol: $mode )"
- ];
- $retval[] = [
- 'https://example.com', 'https://example.com',
- $defaultProto, $server, $canServer, $httpsMode, 443,
- "Testing fully qualified https URLs (no need to expand) "
- . "(defaultProto: $protoDesc , wgServer: $server, "
- . "wgCanonicalServer: $canServer, current request protocol: $mode )"
- ];
- # Would be nice to support this, see fixme on wfExpandUrl()
- $retval[] = [
- "wiki/FooBar", 'wiki/FooBar',
- $defaultProto, $server, $canServer, $httpsMode, 443,
- "Test non-expandable relative URLs (defaultProto: $protoDesc, "
- . "wgServer: $server, wgCanonicalServer: $canServer, "
- . "current request protocol: $mode )"
- ];
-
- // Determine expected protocol
- if ( $protoDesc == 'protocol-relative' ) {
- $p = '';
- } elseif ( $protoDesc == 'current' ) {
- $p = "$mode:";
- } elseif ( $protoDesc == 'canonical' ) {
- $p = "$canServerMode:";
- } else {
- $p = $protoDesc . ':';
- }
- // Determine expected server name
- if ( $protoDesc == 'canonical' ) {
- $srv = $canServer;
- } elseif ( $serverDesc == 'protocol-relative' ) {
- $srv = $p . $server;
- } else {
- $srv = $server;
- }
-
- $retval[] = [
- "$p//wikipedia.org", '//wikipedia.org',
- $defaultProto, $server, $canServer, $httpsMode, 443,
- "Test protocol-relative URL (defaultProto: $protoDesc, "
- . "wgServer: $server, wgCanonicalServer: $canServer, "
- . "current request protocol: $mode )"
- ];
- $retval[] = [
- "$srv/wiki/FooBar",
- '/wiki/FooBar',
- $defaultProto,
- $server,
- $canServer,
- $httpsMode,
- 443,
- "Testing expanding URL beginning with / (defaultProto: $protoDesc, "
- . "wgServer: $server, wgCanonicalServer: $canServer, "
- . "current request protocol: $mode )"
- ];
- }
- }
- }
- }
-
- // Don't add HTTPS port to foreign URLs
- $retval[] = [
- 'https://foreign.example.com/foo',
- 'https://foreign.example.com/foo',
- PROTO_HTTPS,
- '//wiki.example.com',
- 'http://wiki.example.com',
- 'https',
- 111,
- "Don't add HTTPS port to foreign URLs"
- ];
- $retval[] = [
- 'https://foreign.example.com:222/foo',
- 'https://foreign.example.com:222/foo',
- PROTO_HTTPS,
- '//wiki.example.com',
- 'http://wiki.example.com',
- 'https',
- 111,
- "Don't overwrite HTTPS port of foreign URLs"
- ];
- // Do add HTTPS port to local URLs
- $retval[] = [
- 'https://wiki.example.com:111/foo',
- '/foo',
- PROTO_HTTPS,
- '//wiki.example.com',
- 'http://wiki.example.com',
- 'https',
- 111,
- "Do add HTTPS port to protocol-relative URLs"
- ];
-
- return $retval;
- }
-}
];
}
- /**
- * Test, if for all rights a right- message exist,
- * which is used on Special:ListGroupRights as help text
- * Extensions and core
- *
- * @coversNothing
- */
- public function testAllRightsWithMessage() {
- // Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights
- $allRights = User::getAllRights();
- $allMessageKeys = Language::getMessageKeysFor( 'en' );
-
- $rightsWithMessage = [];
- foreach ( $allMessageKeys as $message ) {
- // === 0: must be at beginning of string (position 0)
- if ( strpos( $message, 'right-' ) === 0 ) {
- $rightsWithMessage[] = substr( $message, strlen( 'right-' ) );
- }
- }
-
- sort( $allRights );
- sort( $rightsWithMessage );
-
- $this->assertEquals(
- $allRights,
- $rightsWithMessage,
- 'Each user rights (core/extensions) has a corresponding right- message.'
- );
- }
-
/**
* Test User::editCount
* @group medium
'https://www.mediawiki.org/wiki/Manual:User_rights#Adding_new_rights'
);
}
+
+ /**
+ * Test, if for all rights a right- message exist,
+ * which is used on Special:ListGroupRights as help text
+ * Extensions and core
+ *
+ * @coversNothing
+ */
+ public function testAllRightsWithMessage() {
+ // Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights
+ $allRights = User::getAllRights();
+ $allMessageKeys = Language::getMessageKeysFor( 'en' );
+
+ $rightsWithMessage = [];
+ foreach ( $allMessageKeys as $message ) {
+ // === 0: must be at beginning of string (position 0)
+ if ( strpos( $message, 'right-' ) === 0 ) {
+ $rightsWithMessage[] = substr( $message, strlen( 'right-' ) );
+ }
+ }
+
+ $missing = array_diff(
+ $allRights,
+ $rightsWithMessage
+ );
+
+ $this->assertEquals(
+ [],
+ $missing,
+ 'Each user rights (core/extensions) has a corresponding right- message.'
+ );
+ }
}
/** @var ScopedCallback */
private $ptTeardownScope;
+ private $oldTablePrefix = '';
+
/**
* @defgroup filtering_constants Filtering constants
*
$type = $db->getType();
$prefix = $type === 'oracle' ?
MediaWikiTestCase::ORA_DB_PREFIX : MediaWikiTestCase::DB_PREFIX;
+ $this->oldTablePrefix = $db->tablePrefix();
MediaWikiTestCase::setupTestDB( $db, $prefix );
+ CloneDatabase::changePrefix( $prefix );
$teardown = $this->ptRunner->setDatabase( $db );
$teardown = $this->ptRunner->setupUploads( $teardown );
$this->ptTeardownScope = $teardown;
if ( $this->ptTeardownScope ) {
ScopedCallback::consume( $this->ptTeardownScope );
}
+ CloneDatabase::changePrefix( $this->oldTablePrefix );
}
/**