From c89760278f7a462de1b91927e397e903c52437bd Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Sun, 3 May 2015 10:49:13 -0700 Subject: [PATCH] Add migration to add gitlab trigger type --- .../1f116e06b68_add_gitlab_trigger_type.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 data/migrations/versions/1f116e06b68_add_gitlab_trigger_type.py diff --git a/data/migrations/versions/1f116e06b68_add_gitlab_trigger_type.py b/data/migrations/versions/1f116e06b68_add_gitlab_trigger_type.py new file mode 100644 index 000000000..40d9a9399 --- /dev/null +++ b/data/migrations/versions/1f116e06b68_add_gitlab_trigger_type.py @@ -0,0 +1,25 @@ +"""Add gitlab trigger type + +Revision ID: 1f116e06b68 +Revises: 313179799c8b +Create Date: 2015-05-03 10:45:06.257913 + +""" + +# revision identifiers, used by Alembic. +revision = '1f116e06b68' +down_revision = '313179799c8b' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(tables): + op.bulk_insert(tables.buildtriggerservice, [{'id': 4, 'name': 'gitlab'}]) + + +def downgrade(tables): + op.execute( + tables.buildtriggerservice.delete() + .where(tables.buildtriggerservice.c.name == op.inline_literal('gitlab')) + )