From: Reedy Date: Sun, 6 Jan 2013 03:03:36 +0000 (+0000) Subject: Add "modifyExtensionField" utility function X-Git-Tag: 1.31.0-rc.0~21066^2 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=3ae75526ef96b3dd8f2c9b604f051abf1d1cddfd;p=lhc%2Fweb%2Fwiklou.git Add "modifyExtensionField" utility function As calling $updater->modifyField will do the action immediately (not queued), this may be undesired. So this is a shortcut/utility function like addExtensionField/addExtensionTable etc, instead of the developer calling addExtensionUpdate( array() ) themselves. Change-Id: Ie94f2b42679062c6e106ae560faab26818a9b15c --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 73574828ee..ac3f7b6991 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -295,6 +295,17 @@ abstract class DatabaseUpdater { $this->extensionUpdates[] = array( 'renameIndex', $tableName, $oldIndexName, $newIndexName, $skipBothIndexExistWarning, $sqlPath, true ); } + /** + * @since 1.21 + * + * @param $tableName string The table name + * @param $fieldName string The field to be modified + * @param $sqlPath string The path to the SQL change path + */ + public function modifyExtensionField( $tableName, $fieldName, $sqlPath) { + $this->extensionUpdates[] = array( 'modifyField', $tableName, $fieldName, $sqlPath, true ); + } + /** * * @since 1.20