summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDougal Matthews <dougal@redhat.com>2017-06-13 13:30:23 +0100
committerDougal Matthews <dougal@redhat.com>2017-06-19 07:26:08 +0000
commit58955acef686ae359e3bfe65428532df4f072460 (patch)
tree8b178ab9c66a8447ac71bc99ef8251f235f8309d
parentb09982a5b4d916a1477d49bf5905969b57c496c5 (diff)
Increase the Environment variable column length
Notes
Notes (review): Code-Review+2: Renat Akhmerov <renat.akhmerov@gmail.com> Workflow+1: Renat Akhmerov <renat.akhmerov@gmail.com> Code-Review+1: lidong <lidongbj@inspur.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 19 Jun 2017 09:57:25 +0000 Reviewed-on: https://review.openstack.org/473814 Project: openstack/mistral Branch: refs/heads/stable/ocata
-rw-r--r--mistral/db/sqlalchemy/migration/alembic_migrations/versions/021_increase_env_columns_size.py35
-rw-r--r--mistral/db/v2/sqlalchemy/models.py2
2 files changed, 36 insertions, 1 deletions
diff --git a/mistral/db/sqlalchemy/migration/alembic_migrations/versions/021_increase_env_columns_size.py b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/021_increase_env_columns_size.py
new file mode 100644
index 0000000..52a8a6e
--- /dev/null
+++ b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/021_increase_env_columns_size.py
@@ -0,0 +1,35 @@
1# Copyright 2015 OpenStack Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12# implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16"""Increase environments_v2 column size from JsonDictType to JsonLongDictType
17
18Revision ID: 021
19Revises: 020
20Create Date: 2017-06-13 13:29:41.636094
21
22"""
23
24# revision identifiers, used by Alembic.
25revision = '021'
26down_revision = '020'
27
28from alembic import op
29from mistral.db.sqlalchemy import types as st
30
31
32def upgrade():
33 # Changing column types from JsonDictType to JsonLongDictType
34 op.alter_column('environments_v2', 'variables',
35 type_=st.JsonLongDictType())
diff --git a/mistral/db/v2/sqlalchemy/models.py b/mistral/db/v2/sqlalchemy/models.py
index e638580..4b406f6 100644
--- a/mistral/db/v2/sqlalchemy/models.py
+++ b/mistral/db/v2/sqlalchemy/models.py
@@ -367,7 +367,7 @@ class Environment(mb.MistralSecureModelBase):
367 id = mb.id_column() 367 id = mb.id_column()
368 name = sa.Column(sa.String(200)) 368 name = sa.Column(sa.String(200))
369 description = sa.Column(sa.Text()) 369 description = sa.Column(sa.Text())
370 variables = sa.Column(st.JsonDictType()) 370 variables = sa.Column(st.JsonLongDictType())
371 371
372 372
373class CronTrigger(mb.MistralSecureModelBase): 373class CronTrigger(mb.MistralSecureModelBase):