Asterisk - The Open Source Telephony Project GIT-master-f36a736
58e440314c2a_allow_wildcard_certs.py
Go to the documentation of this file.
1"""allow_wildcard_certs
2
3Revision ID: 58e440314c2a
4Revises: 18e0805d367f
5Create Date: 2022-05-12 12:15:55.343743
6
7"""
8
9# revision identifiers, used by Alembic.
10revision = '58e440314c2a'
11down_revision = '18e0805d367f'
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
23 op.add_column('ps_transports', sa.Column('allow_wildcard_certs', type_=yesno_values))
24
25
27 if op.get_context().bind.dialect.name == 'mssql':
28 op.drop_constraint('ck_ps_transports_allow_wildcard_certs_yesno_values', 'ps_transports')
29 op.drop_column('ps_transports', 'allow_wildcard_certs')