summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-18 18:07:25 -0700
committerBrion Vibber <brion@pobox.com>2010-10-18 18:07:25 -0700
commitebe9972df6c0e20df9ff5d2a6439da1d16c28965 (patch)
tree43eea4dd3965537d3b51b19c687dd231b2ae4e2f
parenta053871ddc6c2e9d395efa928d0546efffd52856 (diff)
tweak unique constraint setup
-rw-r--r--lib/schema.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/schema.php b/lib/schema.php
index 4feb11a87..391f0f1fd 100644
--- a/lib/schema.php
+++ b/lib/schema.php
@@ -234,7 +234,7 @@ class Schema
*/
function appendUniqueKeyDef(array &$sql, $name, array $def)
{
- $sql[] = "UNIQUE $name " . $this->buildIndexList($def);
+ $sql[] = "CONSTRAINT $name UNIQUE " . $this->buildIndexList($def);
}
/**
@@ -618,7 +618,7 @@ class Schema
$sql = array();
$sql[] = 'ADD';
$this->appendUniqueKeyDef($sql, $keyName, $def);
- $phrase[] = implode(' ', $sql);'ADD CONSTRAINT ' . $keyName;
+ $phrase[] = implode(' ', $sql);
}
function appendAlterDropUnique(array &$phrase, $keyName)