diff --git a/migrations/versions/0718ad13e5f3_.py b/migrations/versions/0718ad13e5f3_.py new file mode 100644 index 00000000..e8abf481 --- /dev/null +++ b/migrations/versions/0718ad13e5f3_.py @@ -0,0 +1,32 @@ +"""empty message + +Revision ID: 0718ad13e5f3 +Revises: 69081f1ff387 +Create Date: 2020-11-06 11:08:33.657440 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '0718ad13e5f3' +down_revision = '69081f1ff387' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('data_store', + sa.Column('key', sa.String(), nullable=False), + sa.Column('value', sa.String(), nullable=True), + sa.PrimaryKeyConstraint('key') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('data_store') + # ### end Alembic commands ### diff --git a/migrations/versions/e0dfdbfd6f69_add_columns.py b/migrations/versions/e0dfdbfd6f69_add_columns.py new file mode 100644 index 00000000..585b5202 --- /dev/null +++ b/migrations/versions/e0dfdbfd6f69_add_columns.py @@ -0,0 +1,36 @@ +"""add columns + +Revision ID: e0dfdbfd6f69 +Revises: 0718ad13e5f3 +Create Date: 2020-11-09 08:33:04.585139 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'e0dfdbfd6f69' +down_revision = '0718ad13e5f3' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('data_store', sa.Column('spec_id', sa.String(), nullable=True)) + op.add_column('data_store', sa.Column('study_id', sa.Integer(), nullable=True)) + op.add_column('data_store', sa.Column('task_id', sa.String(), nullable=True)) + op.add_column('data_store', sa.Column('user_id', sa.String(), nullable=True)) + op.add_column('data_store', sa.Column('workflow_id', sa.Integer(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('data_store', 'workflow_id') + op.drop_column('data_store', 'user_id') + op.drop_column('data_store', 'task_id') + op.drop_column('data_store', 'study_id') + op.drop_column('data_store', 'spec_id') + # ### end Alembic commands ### diff --git a/tests/data/study_sponsors_data_store/study_sponsors_data_store.bpmn b/tests/data/study_sponsors_data_store/study_sponsors_data_store.bpmn new file mode 100644 index 00000000..66112583 --- /dev/null +++ b/tests/data/study_sponsors_data_store/study_sponsors_data_store.bpmn @@ -0,0 +1,78 @@ + + + + + SequenceFlow_1nfe5m9 + + + + SequenceFlow_1nfe5m9 + SequenceFlow_1bqiin0 + sponsors = study_info('sponsors') + + + + Flow_0g9waf3 + + + + SequenceFlow_1bqiin0 + Flow_09cika8 + study_data_set('testme','newval') + + + + Flow_09cika8 + Flow_1oeqjuy + out = study_data_get('testme','bogus') + + + + Flow_1oeqjuy + Flow_0g9waf3 + study_data_set('testme','badval') + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +