22850 Posts in 9711 Topics by 2803 members
|Go to End|
29 July 2010 at 9:10pm
I am getting a bit frustrated with backing up and restoring databases because (with mysql) I get a set of SQL inserts to run against the new database... so... in the situation where I had a field in a DataObject, then removed it, it is will still appear in the database export.
How can I stop this happening? any ideas?
30 July 2010 at 1:16am Last edited: 30 July 2010 1:16am
It sounds to me like all you have to do is manually drop the column(s) from the table(s) corresponding to the DataObject you have edited. Once this is done they would disappear from your backups (since they no longer exists).
/dev/build will not drop columns for you and can not (to my knowledge) be configured to do so. If you ask me, it is sound behaviour since it keeps you safe from loosing data in the case of typos and accidental removal of keys/values in $db or $has_one.
30 July 2010 at 1:18am
As I understand it, if you have removed a field in your DataObject model you will also have to manually drop the columns in the MySQL database table if you don't want them showing up in your SQL exports.
The SQL would be something like:
ALTER TABLE `MyTable`
or you can use phpMyAdmin to drop the fields.
30 July 2010 at 1:22am
thanks for these guys, this is what I have done, and I do appreciate that most web developers would be happy with having old data swimming around. I am working with a very large database and this is not only confusing when looking at the data itself but it also increases the size quite alot.
|Go to Top|