diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/073_drop_available_versions_and_iscsi_targets.py b/cinder/db/sqlalchemy/migrate_repo/versions/073_drop_available_versions_and_iscsi_targets.py new file mode 100644 index 00000000000..72c24354350 --- /dev/null +++ b/cinder/db/sqlalchemy/migrate_repo/versions/073_drop_available_versions_and_iscsi_targets.py @@ -0,0 +1,25 @@ +# 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 + + +def upgrade(migrate_engine): + meta = MetaData() + meta.bind = migrate_engine + + services = Table('services', meta, autoload=True) + services.c.rpc_available_version.drop() + services.c.object_available_version.drop() + + iscsi_targets = Table('iscsi_targets', meta, autoload=True) + iscsi_targets.drop() diff --git a/cinder/db/sqlalchemy/models.py b/cinder/db/sqlalchemy/models.py index 2ca43c05b90..77a0ba469bc 100644 --- a/cinder/db/sqlalchemy/models.py +++ b/cinder/db/sqlalchemy/models.py @@ -75,10 +75,6 @@ class Service(BASE, CinderBase): rpc_current_version = Column(String(36)) object_current_version = Column(String(36)) - # FIXME(dulek): In M we've removed rpc_available_version and - # object_available_version from the model. We need to merge a DB migration - # that actually drops these columns from the DB in early Newton. - # replication_status can be: enabled, disabled, not-capable, error, # failed-over or not-configured replication_status = Column(String(255), default="not-capable") diff --git a/cinder/tests/unit/test_migrations.py b/cinder/tests/unit/test_migrations.py index eafcd8b500e..782cb86177a 100644 --- a/cinder/tests/unit/test_migrations.py +++ b/cinder/tests/unit/test_migrations.py @@ -110,6 +110,9 @@ class MigrationsMixin(test_migrations.WalkVersionsMixin): # is performed with the same restrictions as column addition, which # we of course allow. 66, + # NOTE(dulek): 73 drops tables and columns we've stopped using a + # release ago. + 73, ] # NOTE(dulek): We only started requiring things be additive in