##// END OF EJS Templates
setup: change url to github
setup: change url to github

File last commit:

r153:32f4b641
r196:472d1df0 master
Show More
e9fcfbdd9498_connect_resources_to_alert_channels.py
40 lines | 878 B | text/x-python | PythonLexer
/ backend / src / appenlight / migrations / versions / e9fcfbdd9498_connect_resources_to_alert_channels.py
Option to blacklist certain resources from AlertChannels
r123 """connect resources to alert_channels
Revision ID: e9fcfbdd9498
Revises: 55b6e612672f
Create Date: 2018-02-28 13:52:50.717217
"""
# revision identifiers, used by Alembic.
black: reformat source
r153 revision = "e9fcfbdd9498"
down_revision = "55b6e612672f"
Option to blacklist certain resources from AlertChannels
r123
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
black: reformat source
r153 "channels_resources",
sa.Column(
"channel_pkey",
sa.Integer,
sa.ForeignKey(
"alert_channels.pkey", ondelete="CASCADE", onupdate="CASCADE"
),
primary_key=True,
),
sa.Column(
"resource_id",
sa.Integer,
sa.ForeignKey(
"resources.resource_id", ondelete="CASCADE", onupdate="CASCADE"
),
primary_key=True,
),
Option to blacklist certain resources from AlertChannels
r123 )
def downgrade():
black: reformat source
r153 op.drop_table("channels_resources")