diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-20 21:20:09 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-20 21:20:09 +0000 |
| commit | 620ec424bd7fe09c7bde99c4d3b2dbda7fcc3eca (patch) | |
| tree | 9d77f723df36b3bb09bc0b12d4a510cc93c90ae8 /nova | |
| parent | a8fd0ea78aeb483c038e23b545143e5e98992453 (diff) | |
| parent | b539b6acea4797954ff45ad96904dc9e08691525 (diff) | |
| download | nova-620ec424bd7fe09c7bde99c4d3b2dbda7fcc3eca.tar.gz nova-620ec424bd7fe09c7bde99c4d3b2dbda7fcc3eca.tar.xz nova-620ec424bd7fe09c7bde99c4d3b2dbda7fcc3eca.zip | |
Merge "Convert migrations.instance_uuid to String(36)."
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/db/sqlalchemy/migrate_repo/versions/141_update_migrations_instance_uuid.py | 33 | ||||
| -rw-r--r-- | nova/db/sqlalchemy/models.py | 2 |
2 files changed, 34 insertions, 1 deletions
diff --git a/nova/db/sqlalchemy/migrate_repo/versions/141_update_migrations_instance_uuid.py b/nova/db/sqlalchemy/migrate_repo/versions/141_update_migrations_instance_uuid.py new file mode 100644 index 000000000..086435022 --- /dev/null +++ b/nova/db/sqlalchemy/migrate_repo/versions/141_update_migrations_instance_uuid.py @@ -0,0 +1,33 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2012 Red Hat, 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 MetaData, String, Table + + +def upgrade(migrate_engine): + meta = MetaData() + meta.bind = migrate_engine + + migrations = Table('migrations', meta, autoload=True) + migrations.c.instance_uuid.alter(String(36)) + + +def downgrade(migrate_engine): + meta = MetaData() + meta.bind = migrate_engine + + migrations = Table('migrations', meta, autoload=True) + migrations.c.instance_uuid.alter(String(255)) diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index fbcfe7668..5716f9ecd 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -635,7 +635,7 @@ class Migration(BASE, NovaBase): dest_host = Column(String(255)) old_instance_type_id = Column(Integer()) new_instance_type_id = Column(Integer()) - instance_uuid = Column(String(255), ForeignKey('instances.uuid'), + instance_uuid = Column(String(36), ForeignKey('instances.uuid'), nullable=True) #TODO(_cerberus_): enum status = Column(String(255)) |
