Imporve db archiving

Registered by Boris Pavlovic

I found a lot of problems with shadow tables.

1) Contributors that doesn't know about bp db-archiving (that was made in grizzly) are forgeting to update shadow tables in migrations examples:
https://review.openstack.org/#/c/26588/
https://review.openstack.org/#/c/24994/

and also one new patch (that is not in code)
https://review.openstack.org/#/c/28232/3/nova/db/sqlalchemy/migrate_repo/versions/178_make_user_quotas_key_and_value.py

So to avoid such kind of errors and improve a little bit situation we should make 2 things:

1) Add tests for checking that all tables have shadow table, and that columns in table and shadow table are equal
✓ 2) Add generic method in sqlalchemy.utils that creates shadow_table from table

Blueprint information

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

Whiteboard

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

Addressed by: https://review.openstack.org/28562
    Add sqlalchemy migration utils.check_shadow_table method

Addressed by: https://review.openstack.org/28563
    Add sqlalchemy migration utils.create_shadow_table method

Addressed by: https://review.openstack.org/28952
    Move get_table() from test_migrations to sqlalchemy.utils

Addressed by: https://review.openstack.org/28953
    Change db `deleted` column type utils

Addressed by: https://review.openstack.org/28954
    Sync shadow table for 175 and 176 migration

Addressed by: https://review.openstack.org/28955
    Remove copy past from 179 migration

Addressed by: https://review.openstack.org/28956
    Sync shadow table for 179 migration

Addressed by: https://review.openstack.org/28957
    Sync shadow table for 156 migration

Addressed by: https://review.openstack.org/28958
    Sync shadow table for 157 migration

Addressed by: https://review.openstack.org/28959
    Sync shadow table for 159 migration

Addressed by: https://review.openstack.org/28960
    Add db test that checks that shadow tables are up-to-date

Addressed by: https://review.openstack.org/30127
    Fix tests for sqlalchemy utils

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.