Change db `deleted` column type utils
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

n0ano/gantt,n0ano/gantt