4c573e7135bd_fix_tos_field_types Namespace Reference


Functions

def downgrade
def upgrade

Variables

string down_revision = '28887f25a46f'
string revision = '4c573e7135bd'
string YESNO_NAME = 'yesno_values'
list YESNO_VALUES = ['yes', 'no']


Function Documentation

def 4c573e7135bd_fix_tos_field_types::downgrade (  ) 

Definition at line 40 of file 4c573e7135bd_fix_tos_field_types.py.

00040                :
00041 
00042     yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
00043 
00044     # Can't cast string to YESNO_VALUES, so dropping and adding is required
00045     op.drop_column('ps_endpoints', 'tos_audio')
00046     op.drop_column('ps_endpoints', 'tos_video')
00047     op.drop_column('ps_transports', 'tos')
00048 
00049     op.add_column('ps_endpoints', sa.Column('tos_audio', yesno_values))
00050     op.add_column('ps_endpoints', sa.Column('tos_video', yesno_values))
00051     op.add_column('ps_transports', sa.Column('tos', yesno_values))
00052 
00053     # Can't cast integers to YESNO_VALUES, so dropping and adding is required
00054     op.drop_column('ps_endpoints', 'cos_audio')
00055     op.drop_column('ps_endpoints', 'cos_video')
00056     op.drop_column('ps_transports', 'cos')
00057 
00058     op.add_column('ps_endpoints', sa.Column('cos_audio', yesno_values))
00059     op.add_column('ps_endpoints', sa.Column('cos_video', yesno_values))
00060     op.add_column('ps_transports', sa.Column('cos', yesno_values))
00061     pass
    pass

def 4c573e7135bd_fix_tos_field_types::upgrade (  ) 

Definition at line 21 of file 4c573e7135bd_fix_tos_field_types.py.

00021              :
00022     op.alter_column('ps_endpoints', 'tos_audio',
00023                     type_=sa.String(10))
00024     op.alter_column('ps_endpoints', 'tos_video',
00025                     type_=sa.String(10))
00026     op.alter_column('ps_transports', 'tos',
00027                     type_=sa.String(10))
00028 
00029     # Can't cast YENO_VALUES to Integers, so dropping and adding is required
00030     op.drop_column('ps_endpoints', 'cos_audio')
00031     op.drop_column('ps_endpoints', 'cos_video')
00032     op.drop_column('ps_transports', 'cos')
00033 
00034     op.add_column('ps_endpoints', sa.Column('cos_audio', sa.Integer))
00035     op.add_column('ps_endpoints', sa.Column('cos_video', sa.Integer))
00036     op.add_column('ps_transports', sa.Column('cos', sa.Integer))
00037     pass
00038 
00039 
def downgrade():


Variable Documentation

string down_revision = '28887f25a46f'

Definition at line 11 of file 4c573e7135bd_fix_tos_field_types.py.

string revision = '4c573e7135bd'

Definition at line 10 of file 4c573e7135bd_fix_tos_field_types.py.

string YESNO_NAME = 'yesno_values'

Definition at line 18 of file 4c573e7135bd_fix_tos_field_types.py.

list YESNO_VALUES = ['yes', 'no']

Definition at line 19 of file 4c573e7135bd_fix_tos_field_types.py.


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