Normalize for domain_id, i.e. ensure User and Project entities have the
domain_id as a first class attribute.
Both User and Project (as well as Group) entities are owned by a
domain, which is implemented as each having a domain_id foreign key
in their sql representation that points back to the respective
domain in the domain table. This domain_id attribute should also
be required (i.e. not nullable)
Adding a non_nullable foreign key attribute to a table with existing
data causes a few problems since not all DB engines support the
ability to either control the triggering of integrity constraints
or the ability to modify columns after they are created.
To get round the above inconsistencies, two versions of the
upgrade/downgrade functions are supplied, one for those engines
that support dropping columns, and one for those that don’t. For
the latter we are forced to do table copy AND control the triggering
of integrity constraints.
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.downgrade(migrate_engine)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.downgrade_project_table_with_col_drop(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.downgrade_project_table_with_copy(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.downgrade_user_table_with_col_drop(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.downgrade_user_table_with_copy(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.upgrade(migrate_engine)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.upgrade_project_table_with_col_create(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.upgrade_project_table_with_copy(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.upgrade_user_table_with_col_create(meta, migrate_engine, session)
-
keystone.common.sql.migrate_repo.versions.016_normalize_domain_ids.upgrade_user_table_with_copy(meta, migrate_engine, session)