Migrate files hash

Based off the `v2` branch.

Add sha1 column to files table and add trigger to populate it