diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2011-08-17 15:33:08 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2011-08-17 15:33:08 -0400 |
| commit | 7e3f360eb256ba82629a44de60d36be643d5105d (patch) | |
| tree | e25ba1156d31f6f74e29d7d32dec6dda574f8381 | |
| parent | aca07a42fabb7f506cf132b995b4ad0139987b02 (diff) | |
| download | nova-7e3f360eb256ba82629a44de60d36be643d5105d.tar.gz nova-7e3f360eb256ba82629a44de60d36be643d5105d.tar.xz nova-7e3f360eb256ba82629a44de60d36be643d5105d.zip | |
Added migration for accessIPv4 and accessIPv6
| -rw-r--r-- | nova/db/sqlalchemy/migrate_repo/versions/037_add_instances_accessip.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/nova/db/sqlalchemy/migrate_repo/versions/037_add_instances_accessip.py b/nova/db/sqlalchemy/migrate_repo/versions/037_add_instances_accessip.py new file mode 100644 index 000000000..82de2a874 --- /dev/null +++ b/nova/db/sqlalchemy/migrate_repo/versions/037_add_instances_accessip.py @@ -0,0 +1,49 @@ +# Copyright 2011 OpenStack LLC. +# +# 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, Integer, MetaData, Table, String + +meta = MetaData() + +accessIPv4 = Column( + 'access_ip_v4', + String(length=255, convert_unicode=False, assert_unicode=None, + unicode_error=None, _warn_on_bytestring=False), + nullable=True) + +accessIPv6 = Column( + 'access_ip_v6', + String(length=255, convert_unicode=False, assert_unicode=None, + unicode_error=None, _warn_on_bytestring=False), + nullable=True) + +instances = Table('instances', meta, + Column('id', Integer(), primary_key=True, nullable=False), + ) + + + +def upgrade(migrate_engine): + # Upgrade operations go here. Don't create your own engine; + # bind migrate_engine to your metadata + meta.bind = migrate_engine + instances.create_column(accessIPv4) + instances.create_column(accessIPv6) + + +def downgrade(migrate_engine): + # Operations to reverse the above upgrade go here. + meta.bind = migrate_engine + instances.drop_column('access_ip_v4') + instances.drop_column('access_ip_v6') |
