81b01a191a46_pjsip_add_contact_reg_server.py 586 B

1234567891011121314151617181920212223
  1. """pjsip: add contact reg_server
  2. Revision ID: 81b01a191a46
  3. Revises: 65eb22eb195
  4. Create Date: 2016-04-15 15:00:35.024525
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '81b01a191a46'
  8. down_revision = '65eb22eb195'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. op.add_column('ps_contacts', sa.Column('reg_server', sa.String(20)))
  13. op.create_unique_constraint('ps_contacts_uq', 'ps_contacts', ['id','reg_server'])
  14. def downgrade():
  15. op.drop_constraint('ps_contacts_uq', 'ps_contacts', type_='unique')
  16. op.drop_column('ps_contacts', 'reg_server')