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:59 +0000
commit98a6433b9abe9f52055f91225a4d03b6ed73758a (patch)
tree0fac27a41ba0c83e71dc45513ce998f289dc73c7
parent36bb4e8046b2f0785beae027c4dcbfbccfcb2d12 (diff)
Increase the Environment variable column lengthstable/newton
Notes
Notes (review): Code-Review+2: Renat Akhmerov <renat.akhmerov@gmail.com> Workflow+1: Renat Akhmerov <renat.akhmerov@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 19 Jun 2017 09:25:47 +0000 Reviewed-on: https://review.openstack.org/473815 Project: openstack/mistral Branch: refs/heads/stable/newton
-rw-r--r--mistral/db/sqlalchemy/migration/alembic_migrations/versions/020_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/020_increase_env_columns_size.py b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/020_increase_env_columns_size.py
new file mode 100644
index 0000000..545198c
--- /dev/null
+++ b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/020_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: 020
19Revises: 019
20Create Date: 2017-06-13 13:29:41.636094
21
22"""
23
24# revision identifiers, used by Alembic.
25revision = '020'
26down_revision = '019'
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 2b6d0c6..87cd826 100644
--- a/mistral/db/v2/sqlalchemy/models.py
+++ b/mistral/db/v2/sqlalchemy/models.py
@@ -366,7 +366,7 @@ class Environment(mb.MistralSecureModelBase):
366 id = mb.id_column() 366 id = mb.id_column()
367 name = sa.Column(sa.String(200)) 367 name = sa.Column(sa.String(200))
368 description = sa.Column(sa.Text()) 368 description = sa.Column(sa.Text())
369 variables = sa.Column(st.JsonDictType()) 369 variables = sa.Column(st.JsonLongDictType())
370 370
371 371
372class CronTrigger(mb.MistralSecureModelBase): 372class CronTrigger(mb.MistralSecureModelBase):