From 8e2949c4bcba4c7963986c6b06883d74793b053c Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 4 Jul 2019 11:57:59 +1200 Subject: [PATCH] [REF] simple extraction of getFieldAlterSQL --- CRM/Core/BAO/SchemaHandler.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index 8d78e337fd..c67f3744e8 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -759,6 +759,22 @@ MODIFY {$columnName} varchar( $length ) public static function buildFieldChangeSql($params, $indexExist) { $sql = str_repeat(' ', 8); $sql .= "ALTER TABLE {$params['table_name']}"; + return $sql . self::getFieldAlterSQL($params, $indexExist); + } + + /** + * Get the sql to alter an individual field. + * + * This will need to have an ALTER TABLE statement appended but by getting + * by individual field we can do one or many. + * + * @param array $params + * @param bool $indexExist + * + * @return string + */ + public static function getFieldAlterSQL($params, $indexExist) { + $sql = ''; switch ($params['operation']) { case 'add': $separator = "\n"; -- 2.25.1