Is there a possibility to set a notification to warn developers about any Db structure change done?
Is there any tool or a way to let all the developers to be notified if a Db guy or someone within the team makes a change in Db like adding a new column to a table or renaming etc. ?
Maybe a notification email to be sent on any modifications on table structures...
Any advice开发者_JS百科?
Thanks!
It deppends on the DB engine, but you got the triggers, and you can "trigger" them under certain events, for example a change in the DB structure. Every DB engine works with its own triggering system, that's because I don't give you any example. Just examine the doc of yours, or tell us which is yours, and we'll help you also with that.
You can construct a simple schema version table, which is updated each time the database schema is changed by someone. The schema version (i.e the one which the developers are assuming) is held in a config file somewhere, and if a conflict arises, this should be made obvious.
e.g. schema version table in the database has ID = 20110603
and your config file has something like:
db.schema.version=20110529
then, when your app starts, compare the two IDs and log/throw a message as appropriate. That way, you know if you are working against the latest db structure.
精彩评论