64480fd4ed
Conflicts: data/migrations/versions/82297d834ad_add_us_west_location.py test/data/test.db
39 lines
1 KiB
Python
39 lines
1 KiB
Python
"""add new notification kinds
|
|
|
|
Revision ID: 4a0c94399f38
|
|
Revises: 1594a74a74ca
|
|
Create Date: 2014-08-28 16:17:01.898269
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '4a0c94399f38'
|
|
down_revision = '1594a74a74ca'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import mysql
|
|
|
|
def upgrade(tables):
|
|
op.bulk_insert(tables.externalnotificationmethod,
|
|
[
|
|
{'id':4, 'name':'flowdock'},
|
|
{'id':5, 'name':'hipchat'},
|
|
{'id':6, 'name':'slack'},
|
|
])
|
|
|
|
def downgrade(tables):
|
|
op.execute(
|
|
(tables.externalnotificationmethod.delete()
|
|
.where(tables.externalnotificationmethod.c.name == op.inline_literal('flowdock')))
|
|
)
|
|
|
|
op.execute(
|
|
(tables.externalnotificationmethod.delete()
|
|
.where(tables.externalnotificationmethod.c.name == op.inline_literal('hipchat')))
|
|
)
|
|
|
|
op.execute(
|
|
(tables.externalnotificationmethod.delete()
|
|
.where(tables.externalnotificationmethod.c.name == op.inline_literal('slack')))
|
|
)
|