[asterisk-commits] mmichelson: branch 12 r407567 - /branches/12/contrib/ast-db-manage/config/ver...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 6 10:53:27 CST 2014


Author: mmichelson
Date: Thu Feb  6 10:53:24 2014
New Revision: 407567

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407567
Log:
Fix alembic script to work properly in offline mode.

When run in offline mode, this would attempt to check the database for
the presence of a type it was going to try to create. I now check the
context to see if we're running in offline mode and change a parameter
accordingly.


Modified:
    branches/12/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py

Modified: branches/12/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py?view=diff&rev=407567&r1=407566&r2=407567
==============================================================================
--- branches/12/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py (original)
+++ branches/12/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py Thu Feb  6 10:53:24 2014
@@ -11,6 +11,7 @@
 down_revision = '581a4264e537'
 
 from alembic import op
+from alembic import context
 import sqlalchemy as sa
 
 YESNO_NAME = 'yesno_values'
@@ -45,7 +46,8 @@
     # first it will think it already exists and fail
     pjsip_redirect_method_values = sa.Enum(
         *PJSIP_REDIRECT_METHOD_VALUES, name=PJSIP_REDIRECT_METHOD_NAME)
-    pjsip_redirect_method_values.create(op.get_bind(), checkfirst=True)
+    check = False if context.is_offline_mode() else True
+    pjsip_redirect_method_values.create(op.get_bind(), checkfirst=check)
 
     pjsip_transport_method_values = sa.Enum(
         *PJSIP_TRANSPORT_METHOD_VALUES, name=PJSIP_TRANSPORT_METHOD_NAME)




More information about the asterisk-commits mailing list