diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-20 05:24:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-20 05:24:13 +0000 |
| commit | 5c3113b066e61cbc5d8d4d464f8200d4cb5e8395 (patch) | |
| tree | 7b925f456bd1b5047a2da5504ef7dd1947dd136c /nova/virt | |
| parent | a64532f11381547b3b5ea3bc007df724566a75e1 (diff) | |
| parent | 48bd75998a9e68d7dafdeab47fd6c70adb3113f6 (diff) | |
Merge "baremetal: drop 'prov_mac_address' column"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/007_drop_prov_mac_address.py | 36 | ||||
| -rw-r--r-- | nova/virt/baremetal/db/sqlalchemy/models.py | 1 |
2 files changed, 36 insertions, 1 deletions
diff --git a/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/007_drop_prov_mac_address.py b/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/007_drop_prov_mac_address.py new file mode 100644 index 000000000..eb6ae756c --- /dev/null +++ b/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/007_drop_prov_mac_address.py @@ -0,0 +1,36 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2013 NTT DOCOMO, 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 Column, MetaData, String, Table + + +def upgrade(migrate_engine): + meta = MetaData() + meta.bind = migrate_engine + + nodes = Table('bm_nodes', meta, autoload=True) + nodes.drop_column('prov_mac_address') + + +def downgrade(migrate_engine): + meta = MetaData() + meta.bind = migrate_engine + + nodes = Table('bm_nodes', meta, autoload=True) + nodes.create_column(Column('prov_mac_address', String(length=255))) + + # NOTE(arata): The values held by prov_mac_address are lost in upgrade. + # So downgrade has no other choice but to set the column to NULL. diff --git a/nova/virt/baremetal/db/sqlalchemy/models.py b/nova/virt/baremetal/db/sqlalchemy/models.py index 61063f031..dbc9386ec 100644 --- a/nova/virt/baremetal/db/sqlalchemy/models.py +++ b/nova/virt/baremetal/db/sqlalchemy/models.py @@ -45,7 +45,6 @@ class BareMetalNode(BASE, models.NovaBase): pm_address = Column(Text) pm_user = Column(Text) pm_password = Column(Text) - prov_mac_address = Column(Text) task_state = Column(String(255)) terminal_port = Column(Integer) image_path = Column(String(255), nullable=True) |
