Merge "Add Flavor.description attribute"
This commit is contained in:
commit
2a62ad8cbd
nova/db/sqlalchemy
26
nova/db/sqlalchemy/api_migrations/migrate_repo/versions/050_flavors_add_description.py
Normal file
26
nova/db/sqlalchemy/api_migrations/migrate_repo/versions/050_flavors_add_description.py
Normal file
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user