diff options
author | Boris Pavlovic <boris@pavlovic.me> | 2013-01-25 07:14:47 +0400 |
---|---|---|
committer | Boris Pavlovic <boris@pavlovic.me> | 2013-02-12 01:48:37 +0400 |
commit | 2e403b2e05176aa9e642b5a8dfc04221984e9b6f (patch) | |
tree | 6bd562323b0a669775991dd6a5c06bd2be398c44 /nova/context.py | |
parent | 20424b987946ee56e39f88aed7fddd35c54d7207 (diff) | |
download | nova-2e403b2e05176aa9e642b5a8dfc04221984e9b6f.tar.gz nova-2e403b2e05176aa9e642b5a8dfc04221984e9b6f.tar.xz nova-2e403b2e05176aa9e642b5a8dfc04221984e9b6f.zip |
Add generic UC dropper
There is a lot of tables where we should add unique constraints
on upgrade and drop on downgrade, to avoid race conditions.
But there is a problem with SQLite. SQLite does not allow to drop unique constraints.
There is only one way to drop UC in SQLite:
1) create new table, with same columns and UC (but without UC that we want to drop)
2) copy data from old table
3) drop old table
4) create indexes in new table from old
5) rename new table to old table name
For other DB backends is used 'alter table'.
This patch add generic method for dropping UC.
blueprint db-unique-keys
Change-Id: I3e60578d3902559996943868abeb17b41153769b
Diffstat (limited to 'nova/context.py')
0 files changed, 0 insertions, 0 deletions