Fix sqlalchemy migrations

This patch only fixes sqlalchemy migrations:
- add InnoDB engine and utf-8 for all tables,
- using of more appropriate exceptions,
- fix logic and syntax errors.

Partially implements bp: db-sync-models-with-migrations

Change-Id: Ifdc4abe06f8cd0e01e13b003ea30d1e402c9e8ba
Merge "Fix sqlalchemy migrations"