Database schema changes

Some slight changes to the database schema. Not tested. Will test and
commit further changes this weekend.