Better name of test database
Add create-test-db rule to Makefile
Set foreign keys to attachments table