pjsip: Added "reg_server" to contacts.

If the Asterisk system name is set in asterisk.conf, it will be stored
into the "reg_server" field in the ps_contacts table to facilitate
multi-server setups.

ASTERISK-25931

Change-Id: Ia8f6bd2267809c78753b52bcf21835b9b59f4cb8
This commit is contained in:
Alexei Gradinari
2016-04-15 15:26:15 -04:00
committed by Joshua Colp
parent adf32d1191
commit 2b1edee772
6 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
"""pjsip: add contact reg_server
Revision ID: 81b01a191a46
Revises: 65eb22eb195
Create Date: 2016-04-15 15:00:35.024525
"""
# revision identifiers, used by Alembic.
revision = '81b01a191a46'
down_revision = '65eb22eb195'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('ps_contacts', sa.Column('reg_server', sa.String(20)))
op.drop_constraint(UniqueConstraint('id'), 'ps_contacts', type_='unique')
op.create_unique_constraint('ps_contacts_uq', 'ps_contacts', ['id','reg_server'])
def downgrade():
op.drop_constraint('ps_contacts_uq', 'ps_contacts', type_='unique')
op.drop_column('reg_server')
op.create_unique_constraint(None, 'ps_contacts', 'id')