Incorporate DB Changes Into Packaged Block Update?1 user found helpful
So depending on the package and if the scope of the schema'd tables you'd want to make changes in either place, but since you are talking about blocks you'd want to make the changes in the blocktype's db.xml defined schema xml.
That make sense?
> has the db.xml associated with the block
Are you saying that if I update the db.xml file associated with a package block and add new columns, then run an update on the package (new version) that it will automatically create the new columns in the database?
> so i just dropped the tables then ran update.
Now I'm a bit confused, Scott. Are you saying the update mechanism failed during development/testing or that it has failed in the field? I mean, dropping tables would result in data loss, so I'm assuming it's not a strategy you incorporated into the released package.
Any idea why the update failed?
If for some reason you have problems with the schema changes not being reflected, still leave it in the db.xml, but change the table definition manually. This is pretty damn rare but it has happened to me, but not often enough to try to figure out why there was a problem.
The worst part is that depending on the nature of the schema changes and what your package does during install this can be a silent failure and only come back to bite you once you have a bunch of invalid/inconsistent data already stored :(.