From 7674fc6cd8b1467a345cb61ca8a0db337a8b4198 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 20 Oct 2020 20:22:28 +0100 Subject: [PATCH] db: Compact Pike database migrations Compact Pike database migrations into a single migration, '362_pike.py'. Users will now need to update to Pike before updating to Queens or later. Specific changes include: - Add 'attachment_id' column to 'block_device_mapping' table (358) - Add 'uuid' column to 'services' table (359) - Add index covering 'uuid' column of 'services' table (359) - Add 'mapped' column to 'compute_nodes' table (360) - Add index covering 'uuid' column of 'compute_nodes' table (361) - Add 'uuid' column to 'pci_devices' table (362) Change-Id: I1c2e87f4ff4f7115611f33ee7ddb4820309ef104 Signed-off-by: Stephen Finucane --- .../migrate_repo/versions/348_placeholder.py | 23 ----------- .../migrate_repo/versions/349_placeholder.py | 23 ----------- .../migrate_repo/versions/350_placeholder.py | 23 ----------- .../migrate_repo/versions/351_placeholder.py | 23 ----------- .../migrate_repo/versions/352_placeholder.py | 23 ----------- .../migrate_repo/versions/353_placeholder.py | 23 ----------- .../migrate_repo/versions/354_placeholder.py | 23 ----------- .../migrate_repo/versions/355_placeholder.py | 23 ----------- .../migrate_repo/versions/356_placeholder.py | 23 ----------- .../migrate_repo/versions/357_placeholder.py | 23 ----------- .../versions/358_bdm_attachment_id.py | 28 ------------- .../versions/359_add_service_uuid.py | 33 --------------- .../versions/360_add_compute_node_mapped.py | 24 ----------- .../361_add_compute_nodes_uuid_index.py | 41 ------------------- .../versions/362_add_pci_devices_uuid.py | 36 ---------------- .../versions/{347_ocata.py => 362_pike.py} | 7 ++++ nova/db/sqlalchemy/migration.py | 2 +- nova/tests/unit/db/test_migrations.py | 22 ---------- 18 files changed, 8 insertions(+), 415 deletions(-) delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/348_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/349_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/350_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/351_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/352_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/353_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/354_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/355_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/356_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/357_placeholder.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/358_bdm_attachment_id.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/359_add_service_uuid.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/360_add_compute_node_mapped.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/361_add_compute_nodes_uuid_index.py delete mode 100644 nova/db/sqlalchemy/migrate_repo/versions/362_add_pci_devices_uuid.py rename nova/db/sqlalchemy/migrate_repo/versions/{347_ocata.py => 362_pike.py} (99%) diff --git a/nova/db/sqlalchemy/migrate_repo/versions/348_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/348_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/348_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/349_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/349_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/349_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/350_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/350_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/350_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/351_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/351_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/351_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/352_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/352_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/352_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/353_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/353_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/353_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/354_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/354_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/354_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/355_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/355_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/355_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/356_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/356_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/356_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/357_placeholder.py b/nova/db/sqlalchemy/migrate_repo/versions/357_placeholder.py deleted file mode 100644 index a5d6ecd3add5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/357_placeholder.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is a placeholder for backports. -# Do not use this number for new work. New work starts after -# all the placeholders. -# -# See this for more information: -# http://lists.openstack.org/pipermail/openstack-dev/2013-March/006827.html - - -def upgrade(migrate_engine): - pass diff --git a/nova/db/sqlalchemy/migrate_repo/versions/358_bdm_attachment_id.py b/nova/db/sqlalchemy/migrate_repo/versions/358_bdm_attachment_id.py deleted file mode 100644 index da0f46583852..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/358_bdm_attachment_id.py +++ /dev/null @@ -1,28 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -from sqlalchemy import Column -from sqlalchemy import MetaData -from sqlalchemy import String -from sqlalchemy import Table - - -def upgrade(migrate_engine): - meta = MetaData() - meta.bind = migrate_engine - - for prefix in ('', 'shadow_'): - table = Table(prefix + 'block_device_mapping', meta, autoload=True) - new_column = Column('attachment_id', String(36), nullable=True) - if not hasattr(table.c, 'attachment_id'): - table.create_column(new_column) diff --git a/nova/db/sqlalchemy/migrate_repo/versions/359_add_service_uuid.py b/nova/db/sqlalchemy/migrate_repo/versions/359_add_service_uuid.py deleted file mode 100644 index c16a89544266..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/359_add_service_uuid.py +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -from sqlalchemy import Column -from sqlalchemy.engine.reflection import Inspector -from sqlalchemy import Index -from sqlalchemy import MetaData -from sqlalchemy import String -from sqlalchemy import Table - - -def upgrade(migrate_engine): - meta = MetaData(bind=migrate_engine) - for prefix in ('', 'shadow_'): - services = Table(prefix + 'services', meta, autoload=True) - if not hasattr(services.c, 'uuid'): - services.create_column(Column('uuid', String(36), nullable=True)) - - uuid_index_name = 'services_uuid_idx' - indexes = Inspector(migrate_engine).get_indexes('services') - if uuid_index_name not in (i['name'] for i in indexes): - services = Table('services', meta, autoload=True) - Index(uuid_index_name, services.c.uuid, unique=True).create() diff --git a/nova/db/sqlalchemy/migrate_repo/versions/360_add_compute_node_mapped.py b/nova/db/sqlalchemy/migrate_repo/versions/360_add_compute_node_mapped.py deleted file mode 100644 index d5b2acaea658..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/360_add_compute_node_mapped.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2017 Red Hat, Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from sqlalchemy import MetaData, Table, Column, Integer - - -def upgrade(migrate_engine): - meta = MetaData(bind=migrate_engine) - - for prefix in ('', 'shadow_'): - compute_nodes = Table('%scompute_nodes' % prefix, meta, autoload=True) - mapped = Column('mapped', Integer, default=0, nullable=True) - if not hasattr(compute_nodes.c, 'mapped'): - compute_nodes.create_column(mapped) diff --git a/nova/db/sqlalchemy/migrate_repo/versions/361_add_compute_nodes_uuid_index.py b/nova/db/sqlalchemy/migrate_repo/versions/361_add_compute_nodes_uuid_index.py deleted file mode 100644 index be38d9f9a69b..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/361_add_compute_nodes_uuid_index.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 Huawei Technologies Co.,LTD. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -from oslo_log import log as logging -from sqlalchemy import MetaData, Table, Index - -LOG = logging.getLogger(__name__) - - -def _get_table_index(migrate_engine): - meta = MetaData() - meta.bind = migrate_engine - table = Table('compute_nodes', meta, autoload=True) - for idx in table.indexes: - if idx.columns.keys() == ['uuid']: - break - else: - idx = None - return table, idx - - -def upgrade(migrate_engine): - table, index = _get_table_index(migrate_engine) - if index: - LOG.info('Skipped adding compute_nodes_uuid_idx because an ' - 'equivalent index already exists.') - return - index = Index('compute_nodes_uuid_idx', table.c.uuid, unique=True) - index.create(migrate_engine) diff --git a/nova/db/sqlalchemy/migrate_repo/versions/362_add_pci_devices_uuid.py b/nova/db/sqlalchemy/migrate_repo/versions/362_add_pci_devices_uuid.py deleted file mode 100644 index cd0c09f9c1d5..000000000000 --- a/nova/db/sqlalchemy/migrate_repo/versions/362_add_pci_devices_uuid.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -from oslo_db.sqlalchemy import utils -from sqlalchemy import Column -from sqlalchemy import MetaData -from sqlalchemy import String - -from nova.db.sqlalchemy import api - - -def upgrade(migrate_engine): - meta = MetaData() - meta.bind = migrate_engine - - shadow_prefix = api._SHADOW_TABLE_PREFIX - uuid_col = Column('uuid', String(36)) - - pci_devices = utils.get_table(migrate_engine, 'pci_devices') - if not hasattr(pci_devices.c, 'uuid'): - pci_devices.create_column(uuid_col.copy()) - - shadow_pci_devices = utils.get_table(migrate_engine, - shadow_prefix + 'pci_devices') - if not hasattr(shadow_pci_devices.c, 'uuid'): - shadow_pci_devices.create_column(uuid_col.copy()) diff --git a/nova/db/sqlalchemy/migrate_repo/versions/347_ocata.py b/nova/db/sqlalchemy/migrate_repo/versions/362_pike.py similarity index 99% rename from nova/db/sqlalchemy/migrate_repo/versions/347_ocata.py rename to nova/db/sqlalchemy/migrate_repo/versions/362_pike.py index 16a799e93386..90390d18ef77 100644 --- a/nova/db/sqlalchemy/migrate_repo/versions/347_ocata.py +++ b/nova/db/sqlalchemy/migrate_repo/versions/362_pike.py @@ -234,6 +234,7 @@ def upgrade(migrate_engine): Column('boot_index', Integer), Column('image_id', String(length=36), nullable=True), Column('tag', String(255)), + Column('attachment_id', String(36), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8' ) @@ -322,6 +323,8 @@ def upgrade(migrate_engine): Column('cpu_allocation_ratio', Float, nullable=True), Column('uuid', String(36), nullable=True), Column('disk_allocation_ratio', Float, nullable=True), + Column('mapped', Integer, default=0, nullable=True), + Index('compute_nodes_uuid_idx', 'uuid', unique=True), UniqueConstraint( 'host', 'hypervisor_hostname', 'deleted', name='uniq_compute_nodes0host0hypervisor_hostname0deleted', @@ -864,6 +867,7 @@ def upgrade(migrate_engine): Column('request_id', String(36), nullable=True), Column('numa_node', Integer, default=None), Column('parent_addr', String(12), nullable=True), + Column('uuid', String(36)), Index('ix_pci_devices_instance_uuid_deleted', 'instance_uuid', 'deleted'), Index('ix_pci_devices_compute_node_id_deleted', @@ -1079,6 +1083,8 @@ def upgrade(migrate_engine): # which did not generate the constraints Column('forced_down', Boolean(create_constraint=False), default=False), Column('version', Integer, default=0), + Column('uuid', String(36), nullable=True), + Index('services_uuid_idx', 'uuid', unique=True), UniqueConstraint( 'host', 'topic', 'deleted', name='uniq_services0host0topic0deleted'), @@ -1386,6 +1392,7 @@ def upgrade(migrate_engine): Index('networks_vlan_deleted_idx', networks.c.vlan, networks.c.deleted), + # pci_devices Index('ix_pci_devices_compute_node_id_parent_addr_deleted', pci_devices.c.compute_node_id, pci_devices.c.parent_addr, diff --git a/nova/db/sqlalchemy/migration.py b/nova/db/sqlalchemy/migration.py index 897fdd5f4468..9291d318a94b 100644 --- a/nova/db/sqlalchemy/migration.py +++ b/nova/db/sqlalchemy/migration.py @@ -29,7 +29,7 @@ from nova import exception from nova.i18n import _ INIT_VERSION = {} -INIT_VERSION['main'] = 346 +INIT_VERSION['main'] = 361 INIT_VERSION['api'] = 0 _REPOSITORY = {} diff --git a/nova/tests/unit/db/test_migrations.py b/nova/tests/unit/db/test_migrations.py index 8243f0d5363c..0f3c77a20452 100644 --- a/nova/tests/unit/db/test_migrations.py +++ b/nova/tests/unit/db/test_migrations.py @@ -163,7 +163,6 @@ class NovaMigrationsCheckers(test_migrations.ModelsMigrationsSync, self.INIT_VERSION + 1, ] - ocata_placeholders = list(range(348, 358)) pike_placeholders = list(range(363, 373)) queens_placeholders = list(range(379, 389)) # We forgot to add the rocky placeholder. We've also switched to 5 @@ -175,7 +174,6 @@ class NovaMigrationsCheckers(test_migrations.ModelsMigrationsSync, victoria_placeholders = list(range(413, 418)) return (special + - ocata_placeholders + pike_placeholders + queens_placeholders + stein_placeholders + @@ -236,26 +234,6 @@ class NovaMigrationsCheckers(test_migrations.ModelsMigrationsSync, def test_walk_versions(self): self.walk_versions(snake_walk=False, downgrade=False) - def _check_358(self, engine, data): - self.assertColumnExists(engine, 'block_device_mapping', - 'attachment_id') - - def _check_359(self, engine, data): - self.assertColumnExists(engine, 'services', 'uuid') - self.assertIndexMembers(engine, 'services', 'services_uuid_idx', - ['uuid']) - - def _check_360(self, engine, data): - self.assertColumnExists(engine, 'compute_nodes', 'mapped') - self.assertColumnExists(engine, 'shadow_compute_nodes', 'mapped') - - def _check_361(self, engine, data): - self.assertIndexMembers(engine, 'compute_nodes', - 'compute_nodes_uuid_idx', ['uuid']) - - def _check_362(self, engine, data): - self.assertColumnExists(engine, 'pci_devices', 'uuid') - def _check_373(self, engine, data): self.assertColumnExists(engine, 'migrations', 'uuid')