diff options
Diffstat (limited to 'lib/schema.php')
-rw-r--r-- | lib/schema.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/schema.php b/lib/schema.php index 9f2899ba8..4feb11a87 100644 --- a/lib/schema.php +++ b/lib/schema.php @@ -493,12 +493,6 @@ class Schema $uniques = $this->diffArrays($old, $def, 'unique keys'); $indexes = $this->diffArrays($old, $def, 'indexes'); - $total = $fields['count'] + $uniques['count'] + $indexes['count']; - if ($total == 0) { - // nothing to do - return array(); - } - // For efficiency, we want this all in one // query, instead of using our methods. @@ -527,6 +521,13 @@ class Schema $this->appendAlterAddUnique($phrase, $keyName, $def['unique keys'][$keyName]); } + $this->appendAlterExtras($phrase, $tableName); + + if (count($phrase) == 0) { + // nothing to do + return array(); + } + $sql = 'ALTER TABLE ' . $tableName . ' ' . implode(",\n", $phrase); return array($sql); @@ -625,6 +626,11 @@ class Schema $phrase[] = 'DROP CONSTRAINT ' . $keyName; } + function appendAlterExtras(array &$phrase, $tableName) + { + // no-op + } + /** * Quote a db/table/column identifier if necessary. * |