diff --git a/mistral/db/sqlalchemy/migration/alembic_migrations/versions/004_add_description_for_execution.py b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/004_add_description_for_execution.py new file mode 100644 index 000000000..9c0738877 --- /dev/null +++ b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/004_add_description_for_execution.py @@ -0,0 +1,36 @@ +# Copyright 2015 OpenStack Foundation. +# +# 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 description for execution + +Revision ID: 004 +Revises: 003 +Create Date: 2015-06-10 14:23:54.494596 + +""" + +# revision identifiers, used by Alembic. +revision = '004' +down_revision = '003' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column( + 'executions_v2', + sa.Column('description', sa.String(length=255), nullable=True) + ) diff --git a/mistral/db/v2/sqlalchemy/models.py b/mistral/db/v2/sqlalchemy/models.py index d37cb2d09..adde499f4 100644 --- a/mistral/db/v2/sqlalchemy/models.py +++ b/mistral/db/v2/sqlalchemy/models.py @@ -95,6 +95,7 @@ class Execution(mb.MistralSecureModelBase): # Main properties. id = mb.id_column() name = sa.Column(sa.String(80)) + description = sa.Column(sa.String(255), nullable=True) workflow_name = sa.Column(sa.String(80)) spec = sa.Column(st.JsonDictType()) diff --git a/mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py b/mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py index 8feeffe45..7eb9809d6 100644 --- a/mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py +++ b/mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py @@ -709,7 +709,8 @@ WF_EXECS = [ 'updated_at': None, 'context': None, 'task_id': None, - 'trust_id': None + 'trust_id': None, + 'description': None, }, { 'spec': {}, @@ -720,7 +721,8 @@ WF_EXECS = [ 'updated_at': None, 'context': {'image_id': '123123'}, 'task_id': None, - 'trust_id': None + 'trust_id': None, + 'description': None, } ]