Add a maintenance notification kind and make it of the level warning.
This commit is contained in:
parent
b47742b011
commit
4e5e8a08de
5 changed files with 69 additions and 9 deletions
|
@ -0,0 +1,33 @@
|
|||
"""Add the maintenance notification type.
|
||||
|
||||
Revision ID: 4b7ef0c7bdb2
|
||||
Revises: bcdde200a1b
|
||||
Create Date: 2014-06-27 19:09:56.387534
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4b7ef0c7bdb2'
|
||||
down_revision = 'bcdde200a1b'
|
||||
|
||||
from alembic import op
|
||||
from data.model.sqlalchemybridge import gen_sqlalchemy_metadata
|
||||
from data.database import all_models
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
schema = gen_sqlalchemy_metadata(all_models)
|
||||
op.bulk_insert(schema.tables['notificationkind'],
|
||||
[
|
||||
{'id':4, 'name':'maintenance'},
|
||||
])
|
||||
|
||||
|
||||
def downgrade():
|
||||
notificationkind = schema.tables['notificationkind']
|
||||
op.execute(
|
||||
(notificationkind.delete()
|
||||
.where(notificationkind.c.name == op.inline_literal('maintenance')))
|
||||
|
||||
)
|
Reference in a new issue