[asterisk-commits] mjordan: branch 12 r400383 - in /branches/12/contrib/ast-db-manage: config/ c...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 3 12:55:52 CDT 2013


Author: mjordan
Date: Thu Oct  3 12:55:50 2013
New Revision: 400383

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400383
Log:
Update Alembic database scripts for external scripting and PostgreSQL, Oracle

This patch does the following:
1) The env scripts have been updated to be tolerant of a NULL configuration
   file. This occurs when configuration is provided by an external script,
   such that the actual config.ini file is not used.
2) Enum types have all been given names. This is needed for PostgreSQL script
   generation.
3) The identifier meetme_confno_starttime_endtime is greater than 30
   characters, and hence invalid for Oracle databases. This has been truncated
   down to meetme_confno_start_end.


Modified:
    branches/12/contrib/ast-db-manage/config/env.py
    branches/12/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py
    branches/12/contrib/ast-db-manage/voicemail/env.py

Modified: branches/12/contrib/ast-db-manage/config/env.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config/env.py?view=diff&rev=400383&r1=400382&r2=400383
==============================================================================
--- branches/12/contrib/ast-db-manage/config/env.py (original)
+++ branches/12/contrib/ast-db-manage/config/env.py Thu Oct  3 12:55:50 2013
@@ -9,7 +9,10 @@
 
 # Interpret the config file for Python logging.
 # This line sets up loggers basically.
-fileConfig(config.config_file_name)
+try:
+    fileConfig(config.config_file_name)
+except:
+    pass
 
 # add your model's MetaData object here
 # for 'autogenerate' support

Modified: branches/12/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py?view=diff&rev=400383&r1=400382&r2=400383
==============================================================================
--- branches/12/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py (original)
+++ branches/12/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py Thu Oct  3 12:55:50 2013
@@ -68,16 +68,16 @@
         sa.Column('useragent', sa.String(20)),
         sa.Column('lastms', sa.Integer),
         sa.Column('host', sa.String(40)),
-        sa.Column('type', sa.Enum(*TYPE_VALUES)),
+        sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
         sa.Column('context', sa.String(40)),
         sa.Column('permit', sa.String(95)),
         sa.Column('deny', sa.String(95)),
         sa.Column('secret', sa.String(40)),
         sa.Column('md5secret', sa.String(40)),
         sa.Column('remotesecret', sa.String(40)),
-        sa.Column('transport', sa.Enum(*SIP_TRANSPORT_VALUES)),
-        sa.Column('dtmfmode', sa.Enum(*SIP_DTMFMODE_VALUES)),
-        sa.Column('directmedia', sa.Enum(*SIP_DIRECTMEDIA_VALUES)),
+        sa.Column('transport', sa.Enum(*SIP_TRANSPORT_VALUES, name='sip_transport_values')),
+        sa.Column('dtmfmode', sa.Enum(*SIP_DTMFMODE_VALUES, name='sip_dtmfmode_values')),
+        sa.Column('directmedia', sa.Enum(*SIP_DIRECTMEDIA_VALUES, name='sip_directmedia_values')),
         sa.Column('nat', sa.String(29)),
         sa.Column('callgroup', sa.String(40)),
         sa.Column('pickupgroup', sa.String(40)),
@@ -85,26 +85,26 @@
         sa.Column('disallow', sa.String(200)),
         sa.Column('allow', sa.String(200)),
         sa.Column('insecure', sa.String(40)),
-        sa.Column('trustrpid', sa.Enum(*YESNO_VALUES)),
-        sa.Column('progressinband', sa.Enum(*SIP_PROGRESSINBAND_VALUES)),
-        sa.Column('promiscredir', sa.Enum(*YESNO_VALUES)),
-        sa.Column('useclientcode', sa.Enum(*YESNO_VALUES)),
+        sa.Column('trustrpid', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('progressinband', sa.Enum(*SIP_PROGRESSINBAND_VALUES, name='sip_progressinband_values')),
+        sa.Column('promiscredir', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('useclientcode', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('accountcode', sa.String(40)),
         sa.Column('setvar', sa.String(200)),
         sa.Column('callerid', sa.String(40)),
         sa.Column('amaflags', sa.String(40)),
-        sa.Column('callcounter', sa.Enum(*YESNO_VALUES)),
+        sa.Column('callcounter', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('busylevel', sa.Integer),
-        sa.Column('allowoverlap', sa.Enum(*YESNO_VALUES)),
-        sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES)),
-        sa.Column('videosupport', sa.Enum(*YESNO_VALUES)),
+        sa.Column('allowoverlap', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('videosupport', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('maxcallbitrate', sa.Integer),
-        sa.Column('rfc2833compensate', sa.Enum(*YESNO_VALUES)),
+        sa.Column('rfc2833compensate', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('mailbox', sa.String(40)),
-        sa.Column('session-timers', sa.Enum(*SIP_SESSION_TIMERS_VALUES)),
+        sa.Column('session-timers', sa.Enum(*SIP_SESSION_TIMERS_VALUES, name='sip_session_timers_values')),
         sa.Column('session-expires', sa.Integer),
         sa.Column('session-minse', sa.Integer),
-        sa.Column('session-refresher', sa.Enum(*SIP_SESSION_REFRESHER_VALUES)),
+        sa.Column('session-refresher', sa.Enum(*SIP_SESSION_REFRESHER_VALUES, name='sip_session_refresher_values')),
         sa.Column('t38pt_usertpsource', sa.String(40)),
         sa.Column('regexten', sa.String(40)),
         sa.Column('fromdomain', sa.String(40)),
@@ -113,39 +113,39 @@
         sa.Column('defaultip', sa.String(45)),
         sa.Column('rtptimeout', sa.Integer),
         sa.Column('rtpholdtimeout', sa.Integer),
-        sa.Column('sendrpid', sa.Enum(*YESNO_VALUES)),
+        sa.Column('sendrpid', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('outboundproxy', sa.String(40)),
         sa.Column('callbackextension', sa.String(40)),
         sa.Column('timert1', sa.Integer),
         sa.Column('timerb', sa.Integer),
         sa.Column('qualifyfreq', sa.Integer),
-        sa.Column('constantssrc', sa.Enum(*YESNO_VALUES)),
+        sa.Column('constantssrc', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('contactpermit', sa.String(95)),
         sa.Column('contactdeny', sa.String(95)),
-        sa.Column('usereqphone', sa.Enum(*YESNO_VALUES)),
-        sa.Column('textsupport', sa.Enum(*YESNO_VALUES)),
-        sa.Column('faxdetect', sa.Enum(*YESNO_VALUES)),
-        sa.Column('buggymwi', sa.Enum(*YESNO_VALUES)),
+        sa.Column('usereqphone', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('textsupport', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('faxdetect', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('buggymwi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('auth', sa.String(40)),
         sa.Column('fullname', sa.String(40)),
         sa.Column('trunkname', sa.String(40)),
         sa.Column('cid_number', sa.String(40)),
-        sa.Column('callingpres', sa.Enum(*SIP_CALLINGPRES_VALUES)),
+        sa.Column('callingpres', sa.Enum(*SIP_CALLINGPRES_VALUES, name='sip_callingpres_values')),
         sa.Column('mohinterpret', sa.String(40)),
         sa.Column('mohsuggest', sa.String(40)),
         sa.Column('parkinglot', sa.String(40)),
-        sa.Column('hasvoicemail', sa.Enum(*YESNO_VALUES)),
-        sa.Column('subscribemwi', sa.Enum(*YESNO_VALUES)),
+        sa.Column('hasvoicemail', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('subscribemwi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('vmexten', sa.String(40)),
-        sa.Column('autoframing', sa.Enum(*YESNO_VALUES)),
+        sa.Column('autoframing', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('rtpkeepalive', sa.Integer),
         sa.Column('call-limit', sa.Integer),
-        sa.Column('g726nonstandard', sa.Enum(*YESNO_VALUES)),
-        sa.Column('ignoresdpversion', sa.Enum(*YESNO_VALUES)),
-        sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES)),
-        sa.Column('dynamic', sa.Enum(*YESNO_VALUES)),
+        sa.Column('g726nonstandard', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('ignoresdpversion', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('dynamic', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('path', sa.String(256)),
-        sa.Column('supportpath', sa.Enum(*YESNO_VALUES))
+        sa.Column('supportpath', sa.Enum(*YESNO_VALUES, name='yes_no_values'))
     )
     op.create_index('sippeers_name', 'sippeers', ['name'])
     op.create_index('sippeers_name_host', 'sippeers', ['name', 'host'])
@@ -157,7 +157,7 @@
         sa.Column('id', sa.Integer, primary_key=True, nullable=False,
                   autoincrement=True),
         sa.Column('name', sa.String(40), nullable=False, unique=True),
-        sa.Column('type', sa.Enum(*TYPE_VALUES)),
+        sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
         sa.Column('username', sa.String(40)),
         sa.Column('mailbox', sa.String(40)),
         sa.Column('secret', sa.String(40)),
@@ -180,25 +180,25 @@
         sa.Column('language', sa.String(10)),
         sa.Column('callerid', sa.String(100)),
         sa.Column('cid_number', sa.String(40)),
-        sa.Column('sendani', sa.Enum(*YESNO_VALUES)),
+        sa.Column('sendani', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('fullname', sa.String(40)),
-        sa.Column('trunk', sa.Enum(*YESNO_VALUES)),
+        sa.Column('trunk', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('auth', sa.String(20)),
         sa.Column('maxauthreq', sa.Integer),
-        sa.Column('requirecalltoken', sa.Enum(*IAX_REQUIRECALLTOKEN_VALUES)),
-        sa.Column('encryption', sa.Enum(*IAX_ENCRYPTION_VALUES)),
-        sa.Column('transfer', sa.Enum(*IAX_TRANSFER_VALUES)),
-        sa.Column('jitterbuffer', sa.Enum(*YESNO_VALUES)),
-        sa.Column('forcejitterbuffer', sa.Enum(*YESNO_VALUES)),
+        sa.Column('requirecalltoken', sa.Enum(*IAX_REQUIRECALLTOKEN_VALUES, name='iax_requirecalltoken_values')),
+        sa.Column('encryption', sa.Enum(*IAX_ENCRYPTION_VALUES, name='iax_encryption_values')),
+        sa.Column('transfer', sa.Enum(*IAX_TRANSFER_VALUES, name='iax_transfer_values')),
+        sa.Column('jitterbuffer', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('forcejitterbuffer', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('disallow', sa.String(200)),
         sa.Column('allow', sa.String(200)),
         sa.Column('codecpriority', sa.String(40)),
         sa.Column('qualify', sa.String(10)),
-        sa.Column('qualifysmoothing', sa.Enum(*YESNO_VALUES)),
+        sa.Column('qualifysmoothing', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('qualifyfreqok', sa.String(10)),
         sa.Column('qualifyfreqnotok', sa.String(10)),
         sa.Column('timezone', sa.String(20)),
-        sa.Column('adsi', sa.Enum(*YESNO_VALUES)),
+        sa.Column('adsi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('amaflags', sa.String(20)),
         sa.Column('setvar', sa.String(200))
     )
@@ -220,21 +220,21 @@
         sa.Column('alias', sa.String(80)),
         sa.Column('email', sa.String(80)),
         sa.Column('pager', sa.String(80)),
-        sa.Column('attach', sa.Enum(*YESNO_VALUES)),
+        sa.Column('attach', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('attachfmt', sa.String(10)),
         sa.Column('serveremail', sa.String(80)),
         sa.Column('language', sa.String(20)),
         sa.Column('tz', sa.String(30)),
-        sa.Column('deletevoicemail', sa.Enum(*YESNO_VALUES)),
-        sa.Column('saycid', sa.Enum(*YESNO_VALUES)),
-        sa.Column('sendvoicemail', sa.Enum(*YESNO_VALUES)),
-        sa.Column('review', sa.Enum(*YESNO_VALUES)),
-        sa.Column('tempgreetwarn', sa.Enum(*YESNO_VALUES)),
-        sa.Column('operator', sa.Enum(*YESNO_VALUES)),
-        sa.Column('envelope', sa.Enum(*YESNO_VALUES)),
+        sa.Column('deletevoicemail', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('saycid', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('sendvoicemail', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('review', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('tempgreetwarn', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('operator', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('envelope', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('sayduration', sa.Integer),
-        sa.Column('forcename', sa.Enum(*YESNO_VALUES)),
-        sa.Column('forcegreetings', sa.Enum(*YESNO_VALUES)),
+        sa.Column('forcename', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+        sa.Column('forcegreetings', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
         sa.Column('callback', sa.String(80)),
         sa.Column('dialout', sa.String(80)),
         sa.Column('exitcontext', sa.String(80)),
@@ -268,13 +268,13 @@
         sa.Column('maxusers', sa.Integer),
         sa.Column('members', sa.Integer, nullable=False, default=0)
     )
-    op.create_index('meetme_confno_starttime_endtime', 'meetme',
+    op.create_index('meetme_confno_start_end', 'meetme',
                     ['confno', 'starttime', 'endtime'])
 
     op.create_table(
         'musiconhold',
         sa.Column('name', sa.String(80), primary_key=True, nullable=False),
-        sa.Column('mode', sa.Enum(*MOH_MODE_VALUES)),
+        sa.Column('mode', sa.Enum(*MOH_MODE_VALUES, name='moh_mode_values')),
         sa.Column('directory', sa.String(255)),
         sa.Column('application', sa.String(255)),
         sa.Column('digit', sa.String(1)),

Modified: branches/12/contrib/ast-db-manage/voicemail/env.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/voicemail/env.py?view=diff&rev=400383&r1=400382&r2=400383
==============================================================================
--- branches/12/contrib/ast-db-manage/voicemail/env.py (original)
+++ branches/12/contrib/ast-db-manage/voicemail/env.py Thu Oct  3 12:55:50 2013
@@ -9,7 +9,10 @@
 
 # Interpret the config file for Python logging.
 # This line sets up loggers basically.
-fileConfig(config.config_file_name)
+try:
+    fileConfig(config.config_file_name)
+except:
+    pass
 
 # add your model's MetaData object here
 # for 'autogenerate' support




More information about the asterisk-commits mailing list