1
# Copyright 2011 OpenStack LLC
4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5
# not use this file except in compliance with the License. You may obtain
6
# a copy of the License at
8
# http://www.apache.org/licenses/LICENSE-2.0
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
# License for the specific language governing permissions and limitations
16
from sqlalchemy import Column, Integer, MetaData, String, Table
19
def upgrade(migrate_engine):
20
# Upgrade operations go here. Don't create your own engine;
21
# bind migrate_engine to your metadata
23
meta.bind = migrate_engine
25
fixed_ips = Table('fixed_ips', meta, autoload=True)
30
fixed_ips_addressV6 = Column(
34
convert_unicode=False,
37
_warn_on_bytestring=False))
39
fixed_ips_netmaskV6 = Column(
43
convert_unicode=False,
46
_warn_on_bytestring=False))
48
fixed_ips_gatewayV6 = Column(
52
convert_unicode=False,
55
_warn_on_bytestring=False))
56
# Add columns to existing tables
57
fixed_ips.create_column(fixed_ips_addressV6)
58
fixed_ips.create_column(fixed_ips_netmaskV6)
59
fixed_ips.create_column(fixed_ips_gatewayV6)
62
def downgrade(migrate_engine):
64
meta.bind = migrate_engine
66
fixed_ips = Table('fixed_ips', meta, autoload=True)
68
fixed_ips.drop_column('addressV6')
69
fixed_ips.drop_column('netmaskV6')
70
fixed_ips.drop_column('gatewayV6')