From: Roan Kattouw Date: Tue, 14 Nov 2017 02:31:23 +0000 (-0800) Subject: DatabaseUpdater: Add modifyExtensionTable() X-Git-Tag: 1.31.0-rc.0~1520^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=99f1d55818c1cd2ea05b659e327463f31a23e7a8;p=lhc%2Fweb%2Fwiklou.git DatabaseUpdater: Add modifyExtensionTable() We already had modifyExtensionField(), but to do a table modification you still had to do $updater->addExtensionUpdate( [ 'modifyTable', ... ] ); Change-Id: I20368bf3c007a01718513a435de24907dc0aaf81 --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index a317822c0a..54ff712030 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -340,12 +340,22 @@ abstract class DatabaseUpdater { * * @param string $tableName The table name * @param string $fieldName The field to be modified - * @param string $sqlPath The path to the SQL change path + * @param string $sqlPath The path to the SQL patch */ public function modifyExtensionField( $tableName, $fieldName, $sqlPath ) { $this->extensionUpdates[] = [ 'modifyField', $tableName, $fieldName, $sqlPath, true ]; } + /** + * @since 1.31 + * + * @param string $tableName The table name + * @param string $sqlPath The path to the SQL patch + */ + public function modifyExtensionTable( $tableName, $sqlPath ) { + $this->extensionUpdates[] = [ 'modifyTable', $tableName, $sqlPath, true ]; + } + /** * * @since 1.20