Add real unique keys to nova's database

Registered by aeva black

* change soft delete to `deleted`=`id` instead of `deleted`=1.
* Add unique indexes on (`col`, `deleted`)for critical tables.

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
High
Drafter:
None
Direction:
Approved
Assignee:
Boris Pavlovic
Definition:
Approved
Series goal:
Accepted for grizzly
Implementation:
Implemented
Milestone target:
milestone icon 2013.1
Started by
Russell Bryant
Completed by
Vish Ishaya

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/db-unique-keys,n,z

Addressed by: https://review.openstack.org/16339
    Fix error with Duplicate exception not being raised

Addressed by: https://review.openstack.org/16940
    Provide creating real unique indexes for columns.

Addressed by: https://review.openstack.org/18715
    Fix error in test_get_all_by_multiple_options_at_once()

Addressed by: https://review.openstack.org/19097
    Remove restoring soft deleted entries

Addressed by: https://review.openstack.org/19748
    Remove restoring soft deleted entries part 2

Changed priority from medium to high since it blocks db-archiving, which was high priority. --Russell

Addressed by: https://review.openstack.org/20935
    Add generic UC dropper

Addressed by: https://review.openstack.org/20936
    Remove race condition (in TaskLog)

Addressed by: https://review.openstack.org/22144
    Fix typo/bug in generic UC dropper

Addressed by: https://review.openstack.org/22145
    Add generic dropper for duplicate rows

Addressed by: https://review.openstack.org/23051
    Add DBDuplicateEntry exception for unique constraint violations

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.