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

Functions

def downgrade ()
 
def upgrade ()
 

Variables

string down_revision = 'a845e4d8ade8'
 
string revision = 'ef7efc2d3964'
 

Detailed Description

ps_contacts add endpoint and modify expiration_time to bigint

Revision ID: ef7efc2d3964
Revises: a845e4d8ade8
Create Date: 2016-06-02 18:18:46.231920

Function Documentation

◆ downgrade()

def ef7efc2d3964_ps_contacts_add_endpoint_and_modify_.downgrade ( )

Definition at line 29 of file ef7efc2d3964_ps_contacts_add_endpoint_and_modify_.py.

29 def downgrade():
30  context_name = op.get_context().bind.dialect.name
31  if context_name != 'mssql' and context_name != 'mysql':
32  op.drop_index('ps_aors_qualifyfreq_contact')
33  op.drop_index('ps_contacts_qualifyfreq_exp')
34  else:
35  op.drop_index('ps_aors_qualifyfreq_contact', table_name='ps_aors')
36  op.drop_index('ps_contacts_qualifyfreq_exp', table_name='ps_contacts')
37  op.drop_column('ps_contacts', 'endpoint')
38  op.alter_column('ps_contacts', 'expiration_time', type_=sa.String(40))

◆ upgrade()

def ef7efc2d3964_ps_contacts_add_endpoint_and_modify_.upgrade ( )

Definition at line 17 of file ef7efc2d3964_ps_contacts_add_endpoint_and_modify_.py.

17 def upgrade():
18  context = op.get_context()
19 
20  op.add_column('ps_contacts', sa.Column('endpoint', sa.String(40)))
21 
22  if context.bind.dialect.name != 'postgresql':
23  op.alter_column('ps_contacts', 'expiration_time', type_=sa.BigInteger)
24  else:
25  op.execute('ALTER TABLE ps_contacts ALTER COLUMN expiration_time TYPE BIGINT USING expiration_time::bigint')
26 
27  op.create_index('ps_contacts_qualifyfreq_exp', 'ps_contacts', ['qualify_frequency', 'expiration_time'])
28  op.create_index('ps_aors_qualifyfreq_contact', 'ps_aors', ['qualify_frequency', 'contact'])

Variable Documentation

◆ down_revision

string down_revision = 'a845e4d8ade8'

◆ revision

string revision = 'ef7efc2d3964'