22870 Posts in 9579 Topics by 2803 members
|Go to End|
25 April 2009 at 11:07pm
is there a way to cleanup the database from unused fields?
27 April 2009 at 11:26am
It is a fair question and as a developer who has been known to change column names etc during development, I know it can be a pain sometimes!
As far as I know, there is no code available to clean up unused fields. Any code would be dangerous anyway as it would have to assume that any columns not mentioned in the code db declaration is fair game to be removed - there may be reasons why extra columns are manually added to tables however (say for 3rd party data etc).
What I generally do is just manually delete unused columns from tables using a database admin tool like phpMyAdmin.
I don't mind having my development environment a bit messy anyway as I use separate sites for testing & live, so by the time I upload code to live, the column names are settled and few redundant columns show on the live database.
The other point to bear in mind is that in general, a couple of redundant columns on a table will not adversely affect performance to any appreciable level.
That said, I don't like having them in there either!
21 April 2012 at 2:10am
Sometimes I just remove the whole table and then run /dev/build to rebuild the database.
however, you only do that in the development mode and you don't have any live data in the database.
|Go to Top|