[asterisk-commits] file: trunk r428223 - /trunk/contrib/ast-db-manage/config/versions/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 19 06:45:50 CST 2014


Author: file
Date: Wed Nov 19 06:45:47 2014
New Revision: 428223

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=428223
Log:
alembic: Fix alembic migration for 'moh_passthrough' option in res_pjsip.

Added:
    trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py   (with props)
Removed:
    trunk/contrib/ast-db-manage/config/versions/339e1dfa644d_add_moh_passthrough_option_to_pjsip.py

Added: trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py?view=auto&rev=428223
==============================================================================
--- trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py (added)
+++ trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py Wed Nov 19 06:45:47 2014
@@ -1,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')

Propchange: trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list