remove db2 support from tree
This removes db2 support from tree completely. This is an oddball non open database that made doing live data migrations difficult. It is used by 0% of users in the OpenStack User Survey. Supporting commercial software that doesn't have users at the cost of delivering features and fixes to our community is the wrong tradeoff. This corrects that. It rewrites migrations, which we typically don't ever do, but it is better if newton fresh environments fail early in db creation instead of very deep in the data migration process. Change-Id: Ifeb9929e4515e3483eb65d371126afd7672b92a4
This commit is contained in:
parent
4a9dc8ee09
commit
d3edc8b044
@ -34,14 +34,9 @@ def upgrade(migrate_engine):
|
||||
Column('transport_url', Text()),
|
||||
Column('database_connection', Text()),
|
||||
UniqueConstraint('uuid', name='uniq_cell_mappings0uuid'),
|
||||
Index('uuid_idx', 'uuid'),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
||||
# NOTE(mriedem): DB2 creates an index when a unique constraint is created
|
||||
# so trying to add a second index on the uuid column will fail with
|
||||
# error SQL0605W, so omit the index in the case of DB2.
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
Index('uuid_idx', cell_mappings.c.uuid)
|
||||
|
||||
cell_mappings.create(checkfirst=True)
|
||||
|
@ -35,6 +35,7 @@ def upgrade(migrate_engine):
|
||||
Column('project_id', String(length=255), nullable=False),
|
||||
UniqueConstraint('instance_uuid',
|
||||
name='uniq_instance_mappings0instance_uuid'),
|
||||
Index('instance_uuid_idx', 'instance_uuid'),
|
||||
Index('project_id_idx', 'project_id'),
|
||||
ForeignKeyConstraint(columns=['cell_id'],
|
||||
refcolumns=[cell_mappings.c.id]),
|
||||
@ -42,10 +43,4 @@ def upgrade(migrate_engine):
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
||||
# NOTE(mriedem): DB2 creates an index when a unique constraint is created
|
||||
# so trying to add a second index on the instance_uuid column will fail
|
||||
# with error SQL0605W, so omit the index in the case of DB2.
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
Index('instance_uuid_idx', instance_mappings.c.instance_uuid)
|
||||
|
||||
instance_mappings.create(checkfirst=True)
|
||||
|
@ -34,16 +34,11 @@ def upgrade(migrate_engine):
|
||||
Column('host', String(length=255), nullable=False),
|
||||
UniqueConstraint('host',
|
||||
name='uniq_host_mappings0host'),
|
||||
Index('host_idx', 'host'),
|
||||
ForeignKeyConstraint(columns=['cell_id'],
|
||||
refcolumns=[cell_mappings.c.id]),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
||||
# NOTE(mriedem): DB2 creates an index when a unique constraint is created
|
||||
# so trying to add a second index on the host column will fail with error
|
||||
# SQL0605W, so omit the index in the case of DB2.
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
Index('host_idx', host_mappings.c.host)
|
||||
|
||||
host_mappings.create(checkfirst=True)
|
||||
|
@ -33,14 +33,9 @@ def upgrade(migrate_engine):
|
||||
Column('spec', Text, nullable=False),
|
||||
UniqueConstraint('instance_uuid',
|
||||
name='uniq_request_specs0instance_uuid'),
|
||||
Index('request_spec_instance_uuid_idx', 'instance_uuid'),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
||||
# NOTE(mriedem): DB2 creates an index when a unique constraint is created
|
||||
# so trying to add a second index on the host column will fail with error
|
||||
# SQL0605W, so omit the index in the case of DB2.
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
Index('request_spec_instance_uuid_idx', request_specs.c.instance_uuid)
|
||||
|
||||
request_specs.create(checkfirst=True)
|
||||
|
@ -58,18 +58,12 @@ def upgrade(migrate_engine):
|
||||
Column('value', String(length=255)),
|
||||
UniqueConstraint('flavor_id', 'key',
|
||||
name='uniq_flavor_extra_specs0flavor_id0key'),
|
||||
Index('flavor_extra_specs_flavor_id_key_idx', 'flavor_id', 'key'),
|
||||
ForeignKeyConstraint(columns=['flavor_id'], refcolumns=[flavors.c.id]),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
||||
# NOTE(mriedem): DB2 creates an index when a unique constraint is created
|
||||
# so trying to add a second index on the flavor_id/key column will fail
|
||||
# with error SQL0605W, so omit the index in the case of DB2.
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
Index('flavor_extra_specs_flavor_id_key_idx',
|
||||
flavor_extra_specs.c.flavor_id,
|
||||
flavor_extra_specs.c.key)
|
||||
flavor_extra_specs.create(checkfirst=True)
|
||||
|
||||
flavor_projects = Table('flavor_projects', meta,
|
||||
|
@ -48,12 +48,9 @@ def upgrade(migrate_engine):
|
||||
name='uniq_resource_providers0name')
|
||||
uc.create()
|
||||
|
||||
# DB2 automatically creates an index for the unique
|
||||
# constraint above, so skip adding the index on DB2.
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
utils.add_index(migrate_engine, 'resource_providers',
|
||||
'resource_providers_name_idx',
|
||||
['name'])
|
||||
utils.add_index(migrate_engine, 'resource_providers',
|
||||
'resource_providers_name_idx',
|
||||
['name'])
|
||||
|
||||
if not hasattr(resource_providers.c, 'generation'):
|
||||
resource_providers.create_column(generation)
|
||||
@ -87,7 +84,7 @@ def upgrade(migrate_engine):
|
||||
'resource_provider_id', 'resource_class_id', table=inventories,
|
||||
name='uniq_inventories0resource_provider_resource_class')
|
||||
inventories_uc.create()
|
||||
if migrate_engine.name != 'ibm_db_sa':
|
||||
utils.add_index(migrate_engine, 'inventories',
|
||||
'inventories_resource_provider_resource_class_idx',
|
||||
['resource_provider_id', 'resource_class_id'])
|
||||
|
||||
utils.add_index(migrate_engine, 'inventories',
|
||||
'inventories_resource_provider_resource_class_idx',
|
||||
['resource_provider_id', 'resource_class_id'])
|
||||
|
Loading…
Reference in New Issue
Block a user