summaryrefslogtreecommitdiff
path: root/ironic/db/sqlalchemy
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2019-02-26 15:30:26 +0000
committerMark Goddard <mark@stackhpc.com>2019-02-26 15:54:51 +0000
commita105ee094333f36d7d000c19d15dba0f1e900c92 (patch)
tree04c0e119f8c8c120cf5e3f958fc4c739c6a54212 /ironic/db/sqlalchemy
parentba83855111b6d41595be7c1fff6b4c254519b793 (diff)
downloadironic-a105ee094333f36d7d000c19d15dba0f1e900c92.tar.gz
Deploy Templates: add 'extra' field to DB & object
The original patch [1] to add DB & object support for deploy templates did not include an 'extra' field for metadata. This patch adds the field, and bumps the object version. Change-Id: I95b4beae217704defc9eab851780fd9c42847c40 Story: 1722275 Task: 29698
Diffstat (limited to 'ironic/db/sqlalchemy')
-rw-r--r--ironic/db/sqlalchemy/alembic/versions/1e15e7122cc9_add_extra_column_to_deploy_templates.py31
-rw-r--r--ironic/db/sqlalchemy/models.py1
2 files changed, 32 insertions, 0 deletions
diff --git a/ironic/db/sqlalchemy/alembic/versions/1e15e7122cc9_add_extra_column_to_deploy_templates.py b/ironic/db/sqlalchemy/alembic/versions/1e15e7122cc9_add_extra_column_to_deploy_templates.py
new file mode 100644
index 000000000..854b9c2e7
--- /dev/null
+++ b/ironic/db/sqlalchemy/alembic/versions/1e15e7122cc9_add_extra_column_to_deploy_templates.py
@@ -0,0 +1,31 @@
+# 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.
+
+"""add extra column to deploy_templates
+
+Revision ID: 1e15e7122cc9
+Revises: 2aac7e0872f6
+Create Date: 2019-02-26 15:08:18.419157
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '1e15e7122cc9'
+down_revision = '2aac7e0872f6'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ op.add_column('deploy_templates',
+ sa.Column('extra', sa.Text(), nullable=True))
diff --git a/ironic/db/sqlalchemy/models.py b/ironic/db/sqlalchemy/models.py
index 9d90d9aa3..f9dcf467e 100644
--- a/ironic/db/sqlalchemy/models.py
+++ b/ironic/db/sqlalchemy/models.py
@@ -361,6 +361,7 @@ class DeployTemplate(Base):
id = Column(Integer, primary_key=True)
uuid = Column(String(36))
name = Column(String(255), nullable=False)
+ extra = Column(db_types.JsonEncodedDict)
class DeployTemplateStep(Base):