Our database schema is generated programmatically from files in our /models directory. I'd like to figure out a git hook I can use so that when doing a checkout or merge, I compare the SHA1 of the /models directory, and if it is not the same as what I had before, I re-initialize the test database and reload our fixtures.
Is it possible to lookup the SHA1 of the /models directory, save it in a variable, and then compare it to the results after completing the checkout/merge?
Thanks in advance for any pointers.