Merge "Add Flavor.description attribute"

This commit is contained in:
Zuul 2017-11-10 03:22:39 +00:00 committed by Gerrit Code Review
commit 2a62ad8cbd
2 changed files with 27 additions and 0 deletions
nova/db/sqlalchemy
api_migrations/migrate_repo/versions
api_models.py

@ -0,0 +1,26 @@
# 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 Column
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy import Text
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
flavors = Table('flavors', meta, autoload=True)
if not hasattr(flavors.c, 'description'):
flavors.create_column(Column('description', Text()))

@ -190,6 +190,7 @@ class Flavors(API_BASE):
vcpu_weight = Column(Integer)
disabled = Column(Boolean, default=False)
is_public = Column(Boolean, default=True)
description = Column(Text)
class FlavorExtraSpecs(API_BASE):