Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
2da192dbbc65_add_publish_tables Namespace Reference

Functions

def downgrade ()
 
def upgrade ()
 

Variables

string down_revision = '8fce4c573e15'
 
string revision = '2da192dbbc65'
 
string YESNO_NAME = 'yesno_values'
 
list YESNO_VALUES = ['yes', 'no']
 

Function Documentation

◆ downgrade()

def 2da192dbbc65_add_publish_tables.downgrade ( )

Definition at line 70 of file 2da192dbbc65_add_publish_tables.py.

70 def downgrade():
71  op.drop_table('ps_outbound_publishes')
72  op.drop_table('ps_inbound_publications')
73  op.drop_table('ps_asterisk_publications')

◆ upgrade()

def 2da192dbbc65_add_publish_tables.upgrade ( )

Definition at line 20 of file 2da192dbbc65_add_publish_tables.py.

20 def upgrade():
21  ############################# Enums ##############################
22 
23  # yesno_values have already been created, so use postgres enum object
24  # type to get around "already created" issue - works okay with mysql
25  yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
26 
27  op.create_table(
28  'ps_outbound_publishes',
29  sa.Column('id', sa.String(40), nullable=False, unique=True),
30  sa.Column('expiration', sa.Integer),
31  sa.Column('outbound_auth', sa.String(40)),
32  sa.Column('outbound_proxy', sa.String(256)),
33  sa.Column('server_uri', sa.String(256)),
34  sa.Column('from_uri', sa.String(256)),
35  sa.Column('to_uri', sa.String(256)),
36  sa.Column('event', sa.String(40)),
37  sa.Column('max_auth_attempts', sa.Integer),
38  sa.Column('transport', sa.String(40)),
39  sa.Column('multi_user', yesno_values),
40  sa.Column('@body', sa.String(40)),
41  sa.Column('@context', sa.String(256)),
42  sa.Column('@exten', sa.String(256)),
43  )
44 
45  op.create_index('ps_outbound_publishes_id', 'ps_outbound_publishes', ['id'])
46 
47  op.create_table(
48  'ps_inbound_publications',
49  sa.Column('id', sa.String(40), nullable=False, unique=True),
50  sa.Column('endpoint', sa.String(40)),
51  sa.Column('event_asterisk-devicestate', sa.String(40)),
52  sa.Column('event_asterisk-mwi', sa.String(40)),
53  )
54 
55  op.create_index('ps_inbound_publications_id', 'ps_inbound_publications', ['id'])
56 
57  op.create_table(
58  'ps_asterisk_publications',
59  sa.Column('id', sa.String(40), nullable=False, unique=True),
60  sa.Column('devicestate_publish', sa.String(40)),
61  sa.Column('mailboxstate_publish', sa.String(40)),
62  sa.Column('device_state', yesno_values),
63  sa.Column('device_state_filter', sa.String(256)),
64  sa.Column('mailbox_state', yesno_values),
65  sa.Column('mailbox_state_filter', sa.String(256)),
66  )
67 
68  op.create_index('ps_asterisk_publications_id', 'ps_asterisk_publications', ['id'])
69 

Variable Documentation

◆ down_revision

string down_revision = '8fce4c573e15'

Definition at line 11 of file 2da192dbbc65_add_publish_tables.py.

◆ revision

string revision = '2da192dbbc65'

Definition at line 10 of file 2da192dbbc65_add_publish_tables.py.

◆ YESNO_NAME

string YESNO_NAME = 'yesno_values'

Definition at line 17 of file 2da192dbbc65_add_publish_tables.py.

◆ YESNO_VALUES

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

Definition at line 18 of file 2da192dbbc65_add_publish_tables.py.