Merge "Make request_spec.spec MediumText"

This commit is contained in:
Zuul 2017-12-15 18:41:08 +00:00 committed by Gerrit Code Review
commit 2203ffd44f
2 changed files with 26 additions and 1 deletions
nova/db/sqlalchemy
api_migrations/migrate_repo/versions
api_models.py

@ -0,0 +1,25 @@
# 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
from sqlalchemy import Table
from nova.db.sqlalchemy import api_models
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
request_specs = Table('request_specs', meta, autoload=True)
if request_specs.c.spec.type != api_models.MediumText():
request_specs.c.spec.alter(type=api_models.MediumText())

@ -168,7 +168,7 @@ class RequestSpec(API_BASE):
id = Column(Integer, primary_key=True)
instance_uuid = Column(String(36), nullable=False)
spec = Column(Text, nullable=False)
spec = Column(MediumText(), nullable=False)
class Flavors(API_BASE):