Pull request for: DB schema fixes

Added missing annotations for sequence generation, updating the schema
file, small refactoring.