diff options
author | Boris Pavlovic <boris@pavlovic.me> | 2013-05-12 00:44:34 +0400 |
---|---|---|
committer | Boris Pavlovic <boris@pavlovic.me> | 2013-05-24 14:57:45 +0400 |
commit | bf4142bc7083120563638d3eaf0e2463ecbfc40b (patch) | |
tree | db89d6d6a1edd7b527df6671830bf315836077d0 /nova/utils.py | |
parent | 7238438ef218d79a31acb07ea004fca8c2e78798 (diff) | |
download | nova-bf4142bc7083120563638d3eaf0e2463ecbfc40b.tar.gz nova-bf4142bc7083120563638d3eaf0e2463ecbfc40b.tar.xz nova-bf4142bc7083120563638d3eaf0e2463ecbfc40b.zip |
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
Diffstat (limited to 'nova/utils.py')
0 files changed, 0 insertions, 0 deletions