Req #15278 [Opn]: Add option to not drop existing tables

From: Date: Thu, 19 Feb 2009 17:49:49 +0000
Subject: Req #15278 [Opn]: Add option to not drop existing tables
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-43@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=15278&edit=1 ID: 15278 Updated by: jan@horde.org Reported By: jan at horde dot org Summary: Add option to not drop existing tables Status: Open Type: Feature/Change Request Package: MDB2_Schema Package Version: CVS PHP Version: Irrelevant Roadmap Versions: New Comment: Any progress on this? MDB2_Schema is completely unusable due to this behavior at the moment. I just killed a complete database again, because I forgot to check which MDB2_Schema version is installed. Previous Comments: ------------------------------------------------------------------------ [2009-01-31 16:22:45] snytkine I think that if someone wants to drop stale tables, then he can do this by hand or it could be an extra option for updataDatabase() But definitely should NOT be the default behavior Breaking existing API is bad, but this is beyond bad! ------------------------------------------------------------------------ [2009-01-31 16:09:13] snytkine I totally agree. It was very frustrating to find out that after the upgrade of this pear package I ran the schema update and all my existing tables were dropped just because in the new definition XML file I only included a couple of new tables. This totally breaks the backward compatibility and if extremely dangerous because I totally did not expect all my tables to just disappear. I used schema update to add a new table to database, so I create a new definition with just one table, then did something like this: $arrPreviousSchema = $hdlSchema->getDefinitionFromDatabase(); $hdlSchema->updateDatabase($arrCurrentSchema, $arrPreviousSchema); Who whould expect the existing tables to be dropped when updateDatabase specifically takes the current schema as the first argument? I think this is the worst pear package upgrade of all times. For me it was like getting a malisious software from a trusted source. How would you feel if you downloaded some software upgrade, run the upgrade on your computer, then notice that upgraded program installed fine but ALL your other programs were deleted ------------------------------------------------------------------------ [2008-12-09 10:23:17] yunosh Description: ------------ As a follow-up to bug #13608, we need an option to not drop existing tables. At the current state MDB2_Schema is unusable for us personally, since it requires *all* table definitions to be provided in a single schema, breaking modularity. Beside that, it would remove any table in a database that are currently not in the schema, e.g. any tables added by the user manually. IMO this should even be the default behavior. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=15278&edit=1

« previous php.pear.bugs (#43) next »