Asterisk - The Open Source Telephony Project GIT-master-abe0018
3bcc0b5bc2c9_add_allow_reload_to_ps_transports.py
Go to the documentation of this file.
1"""Add allow_reload to ps_transports
2
3Revision ID: 3bcc0b5bc2c9
4Revises: dbc44d5a908
5Create Date: 2016-02-05 17:43:39.183785
6
7"""
8
9# revision identifiers, used by Alembic.
10revision = '3bcc0b5bc2c9'
11down_revision = 'dbc44d5a908'
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_transports', sa.Column('allow_reload', yesno_values))
23
25 if op.get_context().bind.dialect.name == 'mssql':
26 op.drop_constraint('ck_ps_transports_allow_reload_yesno_values','ps_transports')
27 op.drop_column('ps_transports', 'allow_reload')