41
42 op.execute("UPDATE ps_endpoints SET mwi_subscribe_replaces_unsolicited='0'"
43 " WHERE mwi_subscribe_replaces_unsolicited='off'"
44 " OR mwi_subscribe_replaces_unsolicited='false'"
45 " OR mwi_subscribe_replaces_unsolicited='no'")
46 op.execute("UPDATE ps_endpoints SET mwi_subscribe_replaces_unsolicited='1'"
47 " WHERE mwi_subscribe_replaces_unsolicited='on'"
48 " OR mwi_subscribe_replaces_unsolicited='true'"
49 " OR mwi_subscribe_replaces_unsolicited='yes'")
50
51
52
53 if op.get_context().bind.dialect.name == 'mssql':
54 op.drop_constraint('ck_ps_endpoints_mwi_subscribe_replaces_unsolicited_ast_bool_values', 'ps_endpoints')
55 op.alter_column('ps_endpoints', 'mwi_subscribe_replaces_unsolicited',
56 type_=sa.String(5))
57 op.alter_column('ps_endpoints', 'mwi_subscribe_replaces_unsolicited',
58 type_=sa.Integer, postgresql_using='mwi_subscribe_replaces_unsolicited::Integer')
59
60 if op.get_context().bind.dialect.name == 'postgresql':
61 ENUM(name=AST_BOOL_NAME).drop(op.get_bind(), checkfirst=False)