1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2011 OpenStack LLC.
4
# Copyright 2012 Michael Still and Canonical Inc
7
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8
# not use this file except in compliance with the License. You may obtain
9
# a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
# License for the specific language governing permissions and limitations
19
from sqlalchemy import Index, MetaData, Table
22
def upgrade(migrate_engine):
24
meta.bind = migrate_engine
26
for table in ['block_device_mapping',
29
t = Table(table, meta, autoload=True)
30
i = Index('%s_instance_uuid_idx' % table, t.c.instance_uuid)
31
i.create(migrate_engine)
34
def downgrade(migrate_engine):
36
meta.bind = migrate_engine
38
for table in ['block_device_mapping',
41
t = Table(table, meta, autoload=True)
42
i = Index('%s_instance_uuid_idx' % table, t.c.instance_uuid)
43
i.drop(migrate_engine)