Add missing file. ASTERISK-24781
[asterisk/asterisk.git] / contrib / ast-db-manage / config / versions / 23530d604b96_add_rpid_immediate.py
1 #
2 # Asterisk -- An open source telephony toolkit.
3 #
4 # Copyright (C) 2015, Richard Mudgett
5 #
6 # Richard Mudgett <rmudgett@digium.com>
7 #
8 # See http://www.asterisk.org for more information about
9 # the Asterisk project. Please do not directly contact
10 # any of the maintainers of this project for assistance;
11 # the project provides a web site, mailing lists and IRC
12 # channels for your use.
13 #
14 # This program is free software, distributed under the terms of
15 # the GNU General Public License Version 2. See the LICENSE file
16 # at the top of the source tree.
17 #
18
19 """add rpid_immediate
20
21 Revision ID: 23530d604b96
22 Revises: 45e3f47c6c44
23 Create Date: 2015-03-18 17:41:58.055412
24
25 """
26
27 # revision identifiers, used by Alembic.
28 revision = '23530d604b96'
29 down_revision = '45e3f47c6c44'
30
31 from alembic import op
32 import sqlalchemy as sa
33 from sqlalchemy.dialects.postgresql import ENUM
34
35 YESNO_NAME = 'yesno_values'
36 YESNO_VALUES = ['yes', 'no']
37
38 def upgrade():
39     ############################# Enums ##############################
40
41     # yesno_values have already been created, so use postgres enum object
42     # type to get around "already created" issue - works okay with mysql
43     yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
44
45     op.add_column('ps_endpoints', sa.Column('rpid_immediate', yesno_values))
46
47 def downgrade():
48     op.drop_column('ps_endpoints', 'rpid_immediate')