Req #15278 [Opn]: Add option to not drop existing tables
| From: | ifeghali@php.net | Date: | Sat, 21 Feb 2009 21:12:17 +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-53@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: ifeghali@php.net
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:
@Dmitri:
1) MDB2_Schema is beta. It is *not* guaranteed to be backwards
compatible.
2) It is always a good thing to read the change logs when upgrading.
3) updateDatabase() was *not* designed to add new tables to the
database. It was originally designed to compare two full schemas and
apply the diff. If it wasn't acting like that before, that's because it
was malfunctioning.
4) You can always do a "dry run" (disable_query option) before pressing
the "red button".
I completely understands your frustration. Now, be careful next time
and keep the good mod so I can do my job.
Best,
Igor Feghali.
Previous Comments:
------------------------------------------------------------------------
[2009-02-19 18:39:10] ifeghali
I agree with you all folks. Will work on it as soon as posible.
------------------------------------------------------------------------
[2009-02-19 17:49:48] yunosh
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.
------------------------------------------------------------------------
[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