diff options
author | Brenda Wallace <shiny@cpan.org> | 2010-05-17 13:50:37 +1200 |
---|---|---|
committer | Brenda Wallace <shiny@cpan.org> | 2010-05-17 13:50:37 +1200 |
commit | 6f19830c9a1f7f73e6a3b09e78f22f65eb1779c4 (patch) | |
tree | 9b7837e3f267d8fece66cd551f64371e4e1d5bfb | |
parent | a968cc69994588e475218975a6fcceb90b9826f8 (diff) |
fix the column modify on stuff for postgres. change serial to bigserial
-rw-r--r-- | lib/pgsqlschema.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/pgsqlschema.php b/lib/pgsqlschema.php index 583d01e0a..272f7eff6 100644 --- a/lib/pgsqlschema.php +++ b/lib/pgsqlschema.php @@ -143,6 +143,7 @@ class PgsqlSchema extends Schema $uniques = array(); $primary = array(); $indices = array(); + $onupdate = array(); $sql = "CREATE TABLE $name (\n"; @@ -321,7 +322,7 @@ class PgsqlSchema extends Schema public function modifyColumn($table, $columndef) { - $sql = "ALTER TABLE $table MODIFY COLUMN " . + $sql = "ALTER TABLE $table ALTER COLUMN TYPE " . $this->_columnSql($columndef); $res = $this->conn->query($sql); @@ -428,7 +429,9 @@ class PgsqlSchema extends Schema foreach ($tomod as $columnName) { $cd = $this->_byName($columns, $columnName); - $phrase[] = 'MODIFY COLUMN ' . $this->_columnSql($cd); + /* brute force */ + $phrase[] = 'DROP COLUMN ' . $columnName; + $phrase[] = 'ADD COLUMN ' . $this->_columnSql($cd); } $sql = 'ALTER TABLE ' . $tableName . ' ' . implode(', ', $phrase); @@ -505,7 +508,7 @@ class PgsqlSchema extends Schema return $sql; } if (!empty($cd->auto_increment)) { - $type = 'serial'; + $type = "bigserial"; // FIXME: creates the wrong name for the sequence for some internal sequence-lookup function, so better fix this to do the real 'create sequence' dance. } if (!empty($cd->size)) { |