diff options
author | Joshua Colp <jcolp@digium.com> | 2014-11-19 12:45:47 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2014-11-19 12:45:47 +0000 |
commit | b2e766a6b7528224798776742cd3c22af224c862 (patch) | |
tree | 6d189921c530544f2504601a9e48c71f543667cb /contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py | |
parent | 3119c3737f5e1b49c41bbd61475c9a81c0148fe1 (diff) |
alembic: Fix alembic migration for 'moh_passthrough' option in res_pjsip.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py')
-rw-r--r-- | contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py b/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py new file mode 100644 index 000000000..54f08ff0b --- /dev/null +++ b/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py @@ -0,0 +1,30 @@ +"""add moh passthrough option to pjsip + +Revision ID: 15b1430ad6f1 +Revises: 371a3bf4143e +Create Date: 2014-11-19 07:44:51.225703 + +""" + +# revision identifiers, used by Alembic. +revision = '15b1430ad6f1' +down_revision = '371a3bf4143e' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects.postgresql import ENUM + +YESNO_NAME = 'yesno_values' +YESNO_VALUES = ['yes', 'no'] + +def upgrade(): + ############################# Enums ############################## + + # yesno_values have already been created, so use postgres enum object + # type to get around "already created" issue - works okay with mysql + yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False) + + op.add_column('ps_endpoints', sa.Column('moh_passthrough', yesno_values)) + +def downgrade(): + op.drop_column('ps_endpoints', 'moh_passthrough') |