1 """fix suppress_q850_reason_headers 3 Revision ID: 7f85dd44c775 5 Create Date: 2018-09-18 16:16:29.304815 10 revision =
'7f85dd44c775' 11 down_revision =
'fe6592859b85' 13 from alembic
import op
14 import sqlalchemy
as sa
15 from sqlalchemy.dialects.postgresql
import ENUM
17 YESNO_NAME =
'yesno_values' 18 YESNO_VALUES = [
'yes',
'no']
22 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
False)
24 if op.get_context().bind.dialect.name !=
'mssql':
25 op.alter_column(
'ps_endpoints',
'suppress_q850_reason_header', type_=yesno_values,
26 new_column_name=
'suppress_q850_reason_headers')
28 op.alter_column(
'ps_endpoints',
'suppress_q850_reason_header', existing_type=yesno_values, type_=sa.String(3),
29 new_column_name=
'suppress_q850_reason_headers')
30 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
True)
31 op.alter_column(
'ps_endpoints',
'suppress_q850_reason_headers', existing_type=sa.String(3), type_=yesno_values)
35 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
False)
36 if op.get_context().bind.dialect.name !=
'mssql':
37 op.alter_column(
'ps_endpoints',
'suppress_q850_reason_headers', type_=yesno_values,
38 new_column_name=
'suppress_q850_reason_header')
40 op.alter_column(
'ps_endpoints',
'suppress_q850_reason_headers', existing_type=yesno_values, type_=sa.String(3),
41 new_column_name=
'suppress_q850_reason_header')
42 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
True)
43 op.alter_column(
'ps_endpoints',
'suppress_q850_reason_header', existing_type=sa.String(3), type_=yesno_values)