0

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

I want 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, and also the new table added to database schema etc.

In other words, to keep track of all the "ALTERS" of the tables and "CREATE" 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, and who made the changes, who added new table and etc.

Is there any way to find it out? Or enabling an option to be able to track this in the future?

0

There is no way to do that from the database side, but you can version control your schema changes by putting all your schema modification .sql scripts in a Git repository the same way you do with source code.

There are also tools such as FlyWay and Liquibase that can help you with this sort of thing.

0

It depends on which edition you are using. If you are using the community edition, then as far as I know there is no way to audit that. If you are using enterprise edition, then you have the option to use MySQL Enterprise Audit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.