indexes now working in postgres schemas

This commit is contained in:
Brenda Wallace 2010-05-15 15:14:11 +12:00
parent 7cf250ff18
commit 191752138a

View File

@ -172,18 +172,16 @@ class PgsqlSchema extends Schema
$sql .= ",\n primary key (" . implode(',', $primary) . ")"; $sql .= ",\n primary key (" . implode(',', $primary) . ")";
} }
foreach ($indices as $i) {
$sql .= ",\nindex {$name}_{$i}_idx ($i)";
}
$sql .= "); "; $sql .= "); ";
foreach ($uniques as $u) { foreach ($uniques as $u) {
$sql .= "\n CREATE index {$name}_{$u}_idx ON {$name} ($u); "; $sql .= "\n CREATE index {$name}_{$u}_idx ON {$name} ($u); ";
} }
foreach ($indices as $i) {
$sql .= "CREATE index {$name}_{$i}_idx on {$name} ($i)";
}
$res = $this->conn->query($sql); $res = $this->conn->query($sql);
if (PEAR::isError($res)) { if (PEAR::isError($res)) {