1 """Fix pjsip transports verify column 3 Revision ID: 5950038a6ead 5 Create Date: 2014-09-15 06:21:35.047314 10 revision =
'5950038a6ead' 11 down_revision =
'd39508cb8d8' 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']
21 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
False)
23 if op.get_context().bind.dialect.name !=
'mssql':
24 op.alter_column(
'ps_transports',
'verifiy_server', type_=yesno_values,
25 new_column_name=
'verify_server')
27 op.alter_column(
'ps_transports',
'verifiy_server', existing_type=yesno_values, type_=sa.String(3),
28 new_column_name=
'verify_server')
29 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
True)
30 op.alter_column(
'ps_transports',
'verify_server', existing_type=sa.String(3), type_=yesno_values)
34 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
False)
35 if op.get_context().bind.dialect.name !=
'mssql':
36 op.alter_column(
'ps_transports',
'verify_server', type_=yesno_values,
37 new_column_name=
'verifiy_server')
39 op.alter_column(
'ps_transports',
'verify_server', existing_type=yesno_values, type_=sa.String(3),
40 new_column_name=
'verifiy_server')
41 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
True)
42 op.alter_column(
'ps_transports',
'verifiy_server', existing_type=sa.String(3), type_=yesno_values)