Models should be the same as the state in DB after migration

Registered by Elena Ezhova on 2013-07-29

For creation we are using migrations.
We don't have any tests that check that our models are up-to-date.

So we should:
1) Add in __table_args__ indexes and unique constraints
2) Fix all mistakes in models
3) Fix all mistakes in migrations
4) Sync effects of migrations in different backends.
5) Add tests that ensure that models are up-to-date.

This will allow us to find some mistakes or missing indexes and make the work with db cleaner.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Low
Drafter:
Elena Ezhova
Direction:
Needs approval
Assignee:
Elena Ezhova
Definition:
Review
Series goal:
Accepted for havana
Implementation:
Implemented
Milestone target:
milestone icon 2013.2
Started by
Elena Ezhova on 2013-07-31
Completed by
Dolph Mathews on 2013-08-18

Related branches

Sprints

Whiteboard

List of models:

✓Domain
✓GroupDomainGrant
✓GroupProjectGrant
✓Project
✓Role
✓UserDomainGrant
✓UserProjectGrant
✓Endpoint
✓Service
✓Ec2Credential
✓CredentialModel
✓Group
✓User
✓UserGroupMembership
✓PolicyModel
✓TokenModel
✓TrustModel
✓TrustRole

Gerrit topic: https://review.openstack.org/#q,topic:bp/db-sync-models-with-migrations,n,z

Addressed by: https://review.openstack.org/39430
    Sync models with migrations

Addressed by: https://review.openstack.org/39420
    Sync DB models and migrations in keystone.assignment.backends.sql

Addressed by: https://review.openstack.org/40170
    Drop extra credential indexes

tracking this here as 'low priority', but obviously if it represents bug fixes, they need to be handled accordingly -dolph

Gerrit topic: https://review.openstack.org/#q,topic:bug/1319370,n,z

Addressed by: https://review.openstack.org/80630
    Comparision of database models and migrations.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.