17def 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'])