Make request_spec.spec MediumText

request_spec.instance_group.members is a list of instance UUIDs. It
can get so long that it overflows its TEXT column. This patch changes
request_spec.spec to MEDIUMTEXT.

Change-Id: I6bf0fa19b72887803e77b66698587c2108c9372a
Closes-bug: 1738094
This commit is contained in:
Artom Lifshitz 2017-12-14 11:56:47 -05:00 committed by Matt Riedemann
parent 9ecf7d32e0
commit 6a899c5f89
2 changed files with 26 additions and 1 deletions

View File

@ -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())

View File

@ -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):