Fix the migration script to add and remove the logentrykinds for notifications.

This commit is contained in:
yackob03 2014-08-05 14:21:29 -07:00
parent b07eff41f6
commit 420d02cd71

View file

@ -86,6 +86,14 @@ def upgrade():
{'id':9, 'name':'build_failure'},
])
# Manually add the new logentrykind types
op.bulk_insert(schema.tables['logentrykind'],
[
{'id':39, 'name':'add_repo_notification'},
{'id':40, 'name':'delete_repo_notification'},
])
### end Alembic commands ###
@ -108,7 +116,7 @@ def downgrade():
op.drop_index('externalnotificationmethod_name', table_name='externalnotificationmethod')
op.drop_table('externalnotificationmethod')
# Manually remove the notificationkind types
# Manually remove the notificationkind and logentrykind types
notificationkind = schema.tables['notificationkind']
op.execute(
(notificationkind.delete()
@ -134,5 +142,16 @@ def downgrade():
(notificationkind.delete()
.where(notificationkind.c.name == op.inline_literal('build_failure')))
)
op.execute(
(logentrykind.delete()
.where(logentrykind.c.name == op.inline_literal('add_repo_notification')))
)
op.execute(
(logentrykind.delete()
.where(logentrykind.c.name == op.inline_literal('delete_repo_notification')))
)
### end Alembic commands ###