-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change is motivated by the need to do an incremental conversion from using tenant to using project as the name. The database is isolated from the API and can be modified without breaking integrations. ADditional work wil be required to get the API to meet the V3 spec without breaking the V2 spec Change-Id: I7cf7695354071f0ea6252be4730ceec3af0a2f35
- Loading branch information
Adam Young
committed
Jan 25, 2013
1 parent
dd35747
commit 56f194a
Showing
3 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
keystone/common/sql/migrate_repo/versions/014_tenant_to_project.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import sqlalchemy as sql | ||
|
||
|
||
def upgrade(migrate_engine): | ||
meta = sql.MetaData() | ||
meta.bind = migrate_engine | ||
legacy_table = sql.Table('tenant', meta, autoload=True) | ||
legacy_table.rename('project') | ||
legacy_table = sql.Table('user_tenant_membership', meta, autoload=True) | ||
legacy_table.rename('user_project_membership') | ||
|
||
|
||
def downgrade(migrate_engine): | ||
"""Replace API-version specific endpoint tables with one based on v2.""" | ||
meta = sql.MetaData() | ||
meta.bind = migrate_engine | ||
upgrade_table = sql.Table('project', meta, autoload=True) | ||
upgrade_table.rename('tenant') | ||
upgrade_table = sql.Table('user_project_membership', meta, autoload=True) | ||
upgrade_table.rename('user_tenant_membership') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters