Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
New Check - Schema changed #303
Inspired by the two sessions by @SQLDBAWithABeard about the devops process and dbachecks I thought it's strange that there isn't there a check already that would alert that when we were out, or perhaps on holidays, somebody changed the schema and didn't put the change to the repo.
The repo part would be rather difficult to implement but a simply hash of sys.sql_definition, perhaps last modify_date from sys.all_objects should be enough to quickly see if the schema was changed or not.
This check as well as the #300 (suspended checks) would require some state persistence. Perhaps more tests would benefit from it? What would be the best way to do it? json files or tables? I supposed it would depend whether the checks are supposed to be personal per dba or shared by a team.
referenced this issue
Mar 1, 2018
Something to consider on checking dates is converting them to local time. In situations where instances are on UTC or some other offset would have to be accounted for when comparing that date to what is in your versioning system.
Configuration wise, you could simply make a configuration that held the date value. If you are aware when the last change was submitted to your versioning system for a given database, just keep that value updated in your configuration prior to running the check(s).