From fd65ca5916e562c8f0d44fce795fb9e949d7d891 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 24 Apr 2015 16:11:24 -0400 Subject: [PATCH] migration: add custom-git service to database --- ...add_custom_git_trigger_type_to_database.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 data/migrations/versions/37c47a7af956_add_custom_git_trigger_type_to_database.py diff --git a/data/migrations/versions/37c47a7af956_add_custom_git_trigger_type_to_database.py b/data/migrations/versions/37c47a7af956_add_custom_git_trigger_type_to_database.py new file mode 100644 index 000000000..ef2f9efa3 --- /dev/null +++ b/data/migrations/versions/37c47a7af956_add_custom_git_trigger_type_to_database.py @@ -0,0 +1,25 @@ +"""add custom-git trigger type to database + +Revision ID: 37c47a7af956 +Revises: 3fee6f979c2a +Create Date: 2015-04-24 14:50:26.275516 + +""" + +# revision identifiers, used by Alembic. +revision = '37c47a7af956' +down_revision = '3fee6f979c2a' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(tables): + op.bulk_insert(tables.buildtriggerservice, [{'id': 2, 'name': 'custom-git'}]) + + +def downgrade(tables): + op.execute( + tables.buildtriggerservice.delete() + .where(tables.buildtriggerservice.c.name == op.inline_literal('custom-git')) + )