Pull request for: DB schema fixes

Added missing annotations for sequence generation, updating the schema
file, small refactoring.

fk name changes and  index changes