Fix tests for sqlalchemy utils

This fix tests to be able to run it with postgresql and mysql.

Some tests should be run only on sqlite

Method create_shadow_tables raises different exception in different
backends (when we try to create duplicate table):
In postgresql it is ProgrammingError
In sqlite and mysql it is OperationalError
So create new Exception that will be raised in both cases.

bp db-common-migration-and-utils

Change-Id: I11be23106bc01bd3c72dad30edfb31a17177bb34
Change db `deleted` column type utils

Move and refactor methods from 152_migration that allows us to change
type of deleted column to type of id.

There are 2 methods:

utils.change_deleted_column_type_to_id_type() method
This method change type of `deleted` column from Boolean to
type of `id`. This method allows us to do it in generic way
for all backends. It fix problem with sqlite, that doesn't
allow any operation with columns that have CheckConstraints.
And columns with Boolean type have CheckConstraints
(value in (0, 1)). So for sqlite it works through shadow tables.
For others dbs it works though alter table.

utils.change_deleted_column_type_to_boolean_type() methods
This method allows us to revert result of previous method.
Useful for downgrade.

In global these methods could be very useful in olso for other
projects. This is a first step that allows us to create unique
constraints when we are using soft delete.
(Create UC on (column, deleted))

Also it will be useful in nova to remove copy past from 179
migration. Add new migration that will fix also shadow_cells table.
And also there are baremetal tables that should be also migrated.

blueprint db-common-migration-and-utils

Change-Id: Ie14351c52eb50182e6460c97e257395ce2adb8b0
Merge "Fix tests for sqlalchemy utils"
Merge "Change db `deleted` column type utils"