Merge "res_pjsip_notify: improve realtime performance on CLI completion on the endpoint"
[asterisk/asterisk.git] / contrib / ast-db-manage / config / versions / 2bb1a85135ad_pjsip_add_use_callerid_contact.py
1 """pjsip add use_callerid_contact
2
3 Revision ID: 2bb1a85135ad
4 Revises: 7f85dd44c775
5 Create Date: 2018-10-18 15:13:40.462354
6
7 """
8
9 # revision identifiers, used by Alembic.
10 revision = '2bb1a85135ad'
11 down_revision = '465f47f880be'
12
13 from alembic import op
14 import sqlalchemy as sa
15 from sqlalchemy.dialects.postgresql import ENUM
16
17 YESNO_NAME = 'yesno_values'
18 YESNO_VALUES = ['yes', 'no']
19
20
21 def upgrade():
22     ############################# Enums ##############################
23
24     # yesno_values have already been created, so use postgres enum object
25     # type to get around "already created" issue - works okay with mysql
26     yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
27
28     op.add_column('ps_globals', sa.Column('use_callerid_contact', yesno_values))
29
30
31 def downgrade():
32     if op.get_context().bind.dialect.name == 'mssql':
33         op.drop_constraint('ck_ps_globals_use_callerid_contact_yesno_values','ps_globals')
34     op.drop_column('ps_globals', 'use_callerid_contact')