views:

125

answers:

3

Having just started working for a new client I have noticed that their database schema could do with a serious overhaul. I've made some suggestions (naming conventions mainly) which would be acceptable for the new suite of applications we are developing going forward, however the system would also have to support the lagacy names used (i.e. 400 or so externally hosted web applications).

Is there any way I could do the following:

  • Change the naming of tables and columns for use in the new application.
  • Create a permanenet table alias or similar to allow the lagacy code to remain unchaged?

Bit of a long shot.......

A: 

you could rename the actual tables and columns names, then and write a bunch of views to support the old names. I'd not risk breaking or impacting the performance of 400 web sites, though. I think you'll just have to slog through. Draw some good table diagrams (so you can learn the names) and start going on the project.

KM
A: 

One way is to create updatable views. But with all its restrictions.

Arthur
+1  A: 

What people do usually when refactoring is rename the table, create view with the old table name and structure and then make changes to the renamed table.

For instance if you renamed a column from person_id to personid (to enforce a consistent style) the view might reference personid but name it person_id so old code doesn't break.

If you are going to refactor a database and keep old code running, I highly recommend reading http://www.amazon.com/Refactoring-Databases-Evolutionary-Database-Design/dp/0321293533/ref=sr%5F1%5F1?ie=UTF8&s=books&qid=1254840934&sr=8-1

HLGEM