Asterisk - The Open Source Telephony Project GIT-master-f36a736
19b00bc19b7b_add_suppress_q850_reason_headers_to_.py
Go to the documentation of this file.
1"""add suppress_q850_reason_headers to endpoint
2
3Revision ID: 19b00bc19b7b
4Revises: 0be05c3a8225
5Create Date: 2018-07-06 06:30:32.196669
6
7"""
8
9# revision identifiers, used by Alembic.
10revision = '19b00bc19b7b'
11down_revision = '0be05c3a8225'
12
13from alembic import op
14import sqlalchemy as sa
15from sqlalchemy.dialects.postgresql import ENUM
16
17YESNO_NAME = 'yesno_values'
18YESNO_VALUES = ['yes', 'no']
19
20def upgrade():
21 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
22 op.add_column('ps_endpoints', sa.Column('suppress_q850_reason_header', yesno_values))
23
25 if op.get_context().bind.dialect.name == 'mssql':
26 op.drop_constraint('ck_ps_endpoints_suppress_q850_reason_header_yesno_values','ps_endpoints')
27 op.drop_column('ps_endpoints', 'suppress_q850_reason_header')