31cd4f4891ec_add_auto_dtmf_mode Namespace Reference


Functions

def downgrade
def upgrade

Variables

string down_revision = '23530d604b96'
list NEW_ENUM = ['rfc4733', 'inband', 'info', 'auto']
tuple new_type = sa.Enum(*NEW_ENUM, name='pjsip_dtmf_mode_values_v2')
list OLD_ENUM = ['rfc4733', 'inband', 'info']
tuple old_type = sa.Enum(*OLD_ENUM, name='pjsip_dtmf_mode_values')
string revision = '31cd4f4891ec'
tuple tcr


Function Documentation

def 31cd4f4891ec_add_auto_dtmf_mode::downgrade (  ) 

Definition at line 44 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

00044                :
00045     context = op.get_context()
00046 
00047     op.execute(tcr.update().where(tcr.c.directmedia==u'outgoing')
00048                .values(directmedia=None))
00049 
00050     if context.bind.dialect.name != 'postgresql':
00051         op.alter_column('ps_endpoints', 'dtmf_mode',
00052                         type_=old_type,
00053                         existing_type=new_type)
00054     else:
00055         enum = ENUM('rfc4733', 'inband', 'info',
00056                     name='pjsip_dtmf_mode_values')
00057         enum.create(op.get_bind(), checkfirst=False)
00058 
00059         op.execute('ALTER TABLE ps_endpoints ALTER COLUMN dtmf_mode TYPE'
00060                    ' pjsip_dtmf_mode_values USING'
00061                    ' dtmf_mode::text::pjsip_dtmf_mode_values')
00062 
00063         ENUM(name="pjsip_dtmf_mode_values_v2").drop(op.get_bind(), checkfirst=False)
        ENUM(name="pjsip_dtmf_mode_values_v2").drop(op.get_bind(), checkfirst=False)

def 31cd4f4891ec_add_auto_dtmf_mode::upgrade (  ) 

Definition at line 25 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

00025              :
00026     context = op.get_context()
00027 
00028     # Upgrading to this revision WILL clear your directmedia values.
00029     if context.bind.dialect.name != 'postgresql':
00030         op.alter_column('ps_endpoints', 'dtmf_mode',
00031                         type_=new_type,
00032                         existing_type=old_type)
00033     else:
00034         enum = ENUM('rfc4733', 'inband', 'info', 'auto',
00035                     name='pjsip_dtmf_mode_values_v2')
00036         enum.create(op.get_bind(), checkfirst=False)
00037 
00038         op.execute('ALTER TABLE ps_endpoints ALTER COLUMN dtmf_mode TYPE'
00039                    ' pjsip_dtmf_mode_values_v2 USING'
00040                    ' dtmf_mode::text::pjsip_dtmf_mode_values_v2')
00041 
00042         ENUM(name="pjsip_dtmf_mode_values").drop(op.get_bind(), checkfirst=False)
00043 
def downgrade():


Variable Documentation

string down_revision = '23530d604b96'

Definition at line 11 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

list NEW_ENUM = ['rfc4733', 'inband', 'info', 'auto']

Definition at line 17 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

tuple new_type = sa.Enum(*NEW_ENUM, name='pjsip_dtmf_mode_values_v2')

list OLD_ENUM = ['rfc4733', 'inband', 'info']

Definition at line 16 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

tuple old_type = sa.Enum(*OLD_ENUM, name='pjsip_dtmf_mode_values')

Definition at line 19 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

string revision = '31cd4f4891ec'

Definition at line 10 of file 31cd4f4891ec_add_auto_dtmf_mode.py.

tuple tcr

Initial value:

sa.sql.table('ps_endpoints', sa.Column('dtmf_mode', new_type,
                   nullable=True))

Definition at line 22 of file 31cd4f4891ec_add_auto_dtmf_mode.py.


Generated on Thu Apr 16 06:41:37 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6