Asterisk - The Open Source Telephony Project GIT-master-f36a736
Functions | Variables
539f68bede2c_add_peer_supported_to_100rel Namespace Reference

Functions

def downgrade ()
 
def upgrade ()
 

Variables

string down_revision = '9f3692b1654b'
 
list NEW_ENUM = ['no', 'required', 'peer_supported', 'yes']
 
 new_type = sa.Enum(*NEW_ENUM, name='pjsip_100rel_values_v2')
 
list OLD_ENUM = ['no', 'required', 'yes']
 
 old_type = sa.Enum(*OLD_ENUM, name='pjsip_100rel_values')
 
string revision = '539f68bede2c'
 

Function Documentation

◆ downgrade()

def downgrade ( )

Definition at line 42 of file 539f68bede2c_add_peer_supported_to_100rel.py.

42def downgrade():
43 context = op.get_context()
44
45 if context.bind.dialect.name != 'postgresql':
46 op.alter_column('ps_endpoints', '100rel',
47 type_=old_type,
48 existing_type=new_type)
49 else:
50 enum = ENUM(*OLD_ENUM, name='pjsip_100rel_values')
51 enum.create(op.get_bind(), checkfirst=False)
52
53 op.execute('ALTER TABLE ps_endpoints ALTER COLUMN "100rel" TYPE'
54 ' pjsip_100rel_values USING'
55 ' "100rel"::text::pjsip_100rel_values')
56
57 ENUM(name="pjsip_100rel_values_v2").drop(op.get_bind(), checkfirst=False)

◆ upgrade()

def upgrade ( )

Definition at line 24 of file 539f68bede2c_add_peer_supported_to_100rel.py.

24def upgrade():
25 context = op.get_context()
26
27 # Upgrading to this revision WILL clear your directmedia values.
28 if context.bind.dialect.name != 'postgresql':
29 op.alter_column('ps_endpoints', '100rel',
30 type_=new_type,
31 existing_type=old_type)
32 else:
33 enum = ENUM(*NEW_ENUM, name='pjsip_100rel_values_v2')
34 enum.create(op.get_bind(), checkfirst=False)
35
36 op.execute('ALTER TABLE ps_endpoints ALTER COLUMN "100rel" TYPE'
37 ' pjsip_100rel_values_v2 USING'
38 ' "100rel"::text::pjsip_100rel_values_v2')
39
40 ENUM(name="pjsip_100rel_values").drop(op.get_bind(), checkfirst=False)
41

Variable Documentation

◆ down_revision

string down_revision = '9f3692b1654b'

Definition at line 11 of file 539f68bede2c_add_peer_supported_to_100rel.py.

◆ NEW_ENUM

list NEW_ENUM = ['no', 'required', 'peer_supported', 'yes']

Definition at line 19 of file 539f68bede2c_add_peer_supported_to_100rel.py.

◆ new_type

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

Definition at line 22 of file 539f68bede2c_add_peer_supported_to_100rel.py.

◆ OLD_ENUM

list OLD_ENUM = ['no', 'required', 'yes']

Definition at line 18 of file 539f68bede2c_add_peer_supported_to_100rel.py.

◆ old_type

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

Definition at line 21 of file 539f68bede2c_add_peer_supported_to_100rel.py.

◆ revision

string revision = '539f68bede2c'

Definition at line 10 of file 539f68bede2c_add_peer_supported_to_100rel.py.