From 3ae75526ef96b3dd8f2c9b604f051abf1d1cddfd Mon Sep 17 00:00:00 2001 From: Reedy Date: Sun, 6 Jan 2013 03:03:36 +0000 Subject: [PATCH] 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 --- includes/installer/DatabaseUpdater.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.20.1