10aedae86a32_add_outgoing_enum_va Namespace Reference


Functions

def downgrade
def upgrade

Variables

string down_revision = '5950038a6ead'
list NEW_ENUM = ['yes', 'no', 'nonat', 'update', 'outgoing']
tuple new_type = sa.Enum(*NEW_ENUM, name='sip_directmedia_values_v2')
list OLD_ENUM = ['yes', 'no', 'nonat', 'update']
tuple old_type = sa.Enum(*OLD_ENUM, name='sip_directmedia_values')
string revision = '10aedae86a32'
tuple tcr


Function Documentation

def 10aedae86a32_add_outgoing_enum_va::downgrade (  ) 

Definition at line 63 of file 10aedae86a32_add_outgoing_enum_va.py.

00063                :
00064     context = op.get_context()
00065 
00066     op.execute(tcr.update().where(tcr.c.directmedia==u'outgoing')
00067                .values(directmedia=None))
00068 
00069     if context.bind.dialect.name != 'postgresql':
00070         op.alter_column('sippeers', 'directmedia',
00071                         type_=old_type,
00072                         existing_type=new_type)
00073     else:
00074         enum = ENUM("yes", "no", "nonat", "update",
00075                     name="sip_directmedia_values")
00076         enum.create(op.get_bind(), checkfirst=False)
00077 
00078         op.execute('ALTER TABLE sippeers ALTER COLUMN directmedia TYPE'
00079                    ' sip_directmedia_values USING'
00080                    ' directmedia::text::sip_directmedia_values')
00081 
00082         ENUM(name="sip_directmedia_values_v2").drop(op.get_bind(),
00083                                                 checkfirst=False)
                                                checkfirst=False)

def 10aedae86a32_add_outgoing_enum_va::upgrade (  ) 

Definition at line 44 of file 10aedae86a32_add_outgoing_enum_va.py.

00044              :
00045     context = op.get_context()
00046 
00047     # Upgrading to this revision WILL clear your directmedia values.
00048     if context.bind.dialect.name != 'postgresql':
00049         op.alter_column('sippeers', 'directmedia',
00050                         type_=new_type,
00051                         existing_type=old_type)
00052     else:
00053         enum = ENUM("yes", "no", "nonat", "update", "outgoing",
00054                     name="sip_directmedia_values_v2")
00055         enum.create(op.get_bind(), checkfirst=False)
00056 
00057         op.execute('ALTER TABLE sippeers ALTER COLUMN directmedia TYPE'
00058                    ' sip_directmedia_values_v2 USING'
00059                    ' directmedia::text::sip_directmedia_values_v2')
00060 
00061         ENUM(name="sip_directmedia_values").drop(op.get_bind(), checkfirst=False)
00062 
def downgrade():


Variable Documentation

string down_revision = '5950038a6ead'

Definition at line 29 of file 10aedae86a32_add_outgoing_enum_va.py.

list NEW_ENUM = ['yes', 'no', 'nonat', 'update', 'outgoing']

Definition at line 36 of file 10aedae86a32_add_outgoing_enum_va.py.

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

Definition at line 39 of file 10aedae86a32_add_outgoing_enum_va.py.

list OLD_ENUM = ['yes', 'no', 'nonat', 'update']

Definition at line 35 of file 10aedae86a32_add_outgoing_enum_va.py.

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

Definition at line 38 of file 10aedae86a32_add_outgoing_enum_va.py.

string revision = '10aedae86a32'

Definition at line 28 of file 10aedae86a32_add_outgoing_enum_va.py.

tuple tcr

Initial value:

sa.sql.table('sippeers', sa.Column('directmedia', new_type,
                   nullable=True))

Definition at line 41 of file 10aedae86a32_add_outgoing_enum_va.py.


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