diff --git a/data/migrations/versions/4a0c94399f38_add_new_notification_kinds.py b/data/migrations/versions/4a0c94399f38_add_new_notification_kinds.py new file mode 100644 index 000000000..91ed2dd08 --- /dev/null +++ b/data/migrations/versions/4a0c94399f38_add_new_notification_kinds.py @@ -0,0 +1,50 @@ +"""add new notification kinds + +Revision ID: 4a0c94399f38 +Revises: 82297d834ad +Create Date: 2014-08-28 16:17:01.898269 + +""" + +# revision identifiers, used by Alembic. +revision = '4a0c94399f38' +down_revision = '82297d834ad' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql +from data.model.sqlalchemybridge import gen_sqlalchemy_metadata +from data.database import all_models + + +def upgrade(): + schema = gen_sqlalchemy_metadata(all_models) + + op.bulk_insert(schema.tables['externalnotificationmethod'], + [ + {'id':4, 'name':'flowdock'}, + {'id':5, 'name':'hipchat'}, + {'id':6, 'name':'slack'}, + ]) + +def downgrade(): + schema = gen_sqlalchemy_metadata(all_models) + externalnotificationmethod = schema.tables['externalnotificationmethod'] + + op.execute( + (externalnotificationmethod.delete() + .where(externalnotificationmethod.c.name == op.inline_literal('flowdock'))) + + ) + + op.execute( + (externalnotificationmethod.delete() + .where(externalnotificationmethod.c.name == op.inline_literal('hipchat'))) + + ) + + op.execute( + (externalnotificationmethod.delete() + .where(externalnotificationmethod.c.name == op.inline_literal('slack'))) + + ) diff --git a/data/migrations/versions/82297d834ad_add_us_west_location.py b/data/migrations/versions/82297d834ad_add_us_west_location.py index 59eb1f800..1eb2e12ff 100644 --- a/data/migrations/versions/82297d834ad_add_us_west_location.py +++ b/data/migrations/versions/82297d834ad_add_us_west_location.py @@ -28,9 +28,9 @@ def upgrade(): def downgrade(): schema = gen_sqlalchemy_metadata(all_models) + imagestoragelocation = schema.tables['imagestoragelocation'] op.execute( (imagestoragelocation.delete() .where(imagestoragelocation.c.name == op.inline_literal('s3_us_west_1'))) - )