Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is it somehow possible to keep track of changes made to the STRUCTURE (not the data) made to tables?

I mean, i don't want to know when rows are inserted/updated/deleted, what i want is to know when the table definition is been changed (and what those changes were). E.g. to know if/when a column was added, removed, if a column type was changed, if an index was added, etc.

In other words, to keep track of all the "ALTERS" of the tables. (and the state before those alters)

I'd like this to know exactly when some changes were made, and to keep track of discrepancies of data, for example to know when a column was changed to hold VARCHARs instead of INTs (just an idea), or when a new column was added, etc.

So is there a way to do this?

I am using MySQL, version 5.1.66. And, if it is not possible in MySQL, is it in other Databases?

Thanks

share|improve this question
3  
In SQL-Server, you can do this using DDL triggers –  ypercube Jul 11 '13 at 20:18
    
In a disciplined development environment, you'd use your version control system--subversion, mercurial, git, even RCS in a pinch. –  Mike Sherrill 'Cat Recall' Jul 11 '13 at 22:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.