~ubuntu-branches/ubuntu/trusty/cinder/trusty

« back to all changes in this revision

Viewing changes to cinder/db/sqlalchemy/migrate_repo/versions/048_add_zone_name.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-22 09:57:46 UTC
  • Revision ID: package-import@ubuntu.com-20120522095746-9lm71yvzltjybk4b
Tags: upstream-2012.2~f1~20120503.2
ImportĀ upstreamĀ versionĀ 2012.2~f1~20120503.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2011 OpenStack LLC.
 
2
#
 
3
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
4
#    not use this file except in compliance with the License. You may obtain
 
5
#    a copy of the License at
 
6
#
 
7
#         http://www.apache.org/licenses/LICENSE-2.0
 
8
#
 
9
#    Unless required by applicable law or agreed to in writing, software
 
10
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
11
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
12
#    License for the specific language governing permissions and limitations
 
13
#    under the License.
 
14
 
 
15
from sqlalchemy import Column, Integer, MetaData, String, Table
 
16
 
 
17
 
 
18
def upgrade(migrate_engine):
 
19
    meta = MetaData()
 
20
    meta.bind = migrate_engine
 
21
 
 
22
    zones = Table('zones', meta, autoload=True)
 
23
    name = Column('name', String(255))
 
24
    zones.create_column(name)
 
25
 
 
26
 
 
27
def downgrade(migrate_engine):
 
28
    meta = MetaData()
 
29
    meta.bind = migrate_engine
 
30
 
 
31
    zones = Table('zones', meta, autoload=True)
 
32
 
 
33
    zones.drop_column('name')