Port datastore fixtures fix to intermediate schema changes branch
This is a port of the datastore fixtures fix from !399 (merged) to the db-schema-improvements
branch. This is not a clean port, as the table structures have changed in this branch (which accommodates the changes from #206 (closed)).
Related to #206 (closed).