X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpgsqlschema.php;h=272f7eff683f354e5ca72a42401e7e0ddd0c5c4c;hb=119d0f7dbab40f30170ba263de78d7e9cea984db;hp=16639ff1b07c8ea2556ec33b9855468aabcf1172;hpb=a467c0ebbab22a220972e458de0652e523bc12d7;p=quix0rs-gnu-social.git diff --git a/lib/pgsqlschema.php b/lib/pgsqlschema.php index 16639ff1b0..272f7eff68 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)) { @@ -520,9 +523,9 @@ class PgsqlSchema extends Schema $sql .= ($cd->nullable) ? "null " : "not null "; } - if (!empty($cd->extra)) { - $sql .= "{$cd->extra} "; - } +// if (!empty($cd->extra)) { +// $sql .= "{$cd->extra} "; +// } return $sql; }