Bug #19676 [Opn]: Postgresql Alter table remove autoincrement
| From: | daniel dot oconnor at gmail dot com | Date: | Sat, 03 Nov 2012 14:50:34 +0000 |
| Subject: | Bug #19676 [Opn]: Postgresql Alter table remove autoincrement | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-9280@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19676&edit=1
ID: 19676
Updated by: daniel.oconnor@gmail.com
Reported By: brice at bmaron dot net
Summary: Postgresql Alter table remove autoincrement
Status: Open
Type: Bug
Package: MDB2_Schema
Operating System: Linux- Debian Stable
Package Version: 0.8.5
PHP Version: 5.3.2
-Assigned To:
+Assigned To: danielc
Roadmap Versions:
New Comment:
-Assigned To:
+Assigned To: danielc
Previous Comments:
------------------------------------------------------------------------
[2012-10-26 09:16:12] emerzh
Added #patch bug:19676;patch:v2patch;revision:1351239372;.
------------------------------------------------------------------------
[2012-10-26 09:02:49] emerzh
Added #patch bug:19676;patch:v1patch;revision:1351238569;.
------------------------------------------------------------------------
[2012-10-26 08:57:27] emerzh
Description:
------------
In Owncloud, we use MDB2 schema to manage our DB migrations..
some users on postgresql had problems with primary keys when an update
happend
The schema was even not changed
MDB2 change all
oc_calendar_objects . id => default
nextval('oc_calendar_objects_id_seq');
to
oc_calendar_objects . id => default 0;
If made a patch to work around the problem
I made a patch for this problem : https://gist.github.com/3955908
Test script:
---------------
have a schema like this with PG
<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<name>*dbprefix*calendar_objects</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<unsigned>true</unsigned>
<length>4</length>
</field>
</declaration>
</table>
and try to do the update of you db
check your DB and see the default value is gone
Expected result:
----------------
Leave the sequence as is.
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19676&edit=1