[asterisk-commits] rmudgett: branch 12 r420211 - in /branches/12/contrib/ast-db-manage: ./ confi...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 6 11:51:54 CDT 2014


Author: rmudgett
Date: Wed Aug  6 11:51:49 2014
New Revision: 420211

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=420211
Log:
alembic: Adjust sippeers, queue_members, and voicemail_messages tables.

* Increased the sippeers useragent max string size to 255.

* Changed the queue_members uniqueid to an auto incremented integer
instead of a string.

* Increased the voicemail_messages BLOB size to LONGBLOB on mysql.

* Fixed the add_tables_for_pjsip config change version downgrade actions
to drop a table it created.

* Adjusted the sample alembic.ini files cdr.ini.sample, config.ini.sample,
and voicemail.ini.sample to give a mysql and postgres sqlalchemy.url
lines.

ASTERISK-23847 #close
Reported by: Stephen More

ASTERISK-23825 #close
Reported by: Stephen More

ASTERISK-23909 #close
Reported by: Stephen More

Review: https://reviewboard.asterisk.org/r/3870/

Added:
    branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py   (with props)
    branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py   (with props)
    branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py   (with props)
Modified:
    branches/12/contrib/ast-db-manage/cdr.ini.sample
    branches/12/contrib/ast-db-manage/config.ini.sample
    branches/12/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
    branches/12/contrib/ast-db-manage/voicemail.ini.sample

Modified: branches/12/contrib/ast-db-manage/cdr.ini.sample
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/cdr.ini.sample?view=diff&rev=420211&r1=420210&r2=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/cdr.ini.sample (original)
+++ branches/12/contrib/ast-db-manage/cdr.ini.sample Wed Aug  6 11:51:49 2014
@@ -15,7 +15,10 @@
 # the 'revision' command, regardless of autogenerate
 # revision_environment = false
 
-sqlalchemy.url = mysql://user:pass@localhost/voicemail
+#sqlalchemy.url = driver://user:pass@localhost/dbname
+
+#sqlalchemy.url = postgresql://user:pass@localhost/cdr
+sqlalchemy.url = mysql://user:pass@localhost/cdr
 
 
 # Logging configuration

Modified: branches/12/contrib/ast-db-manage/config.ini.sample
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config.ini.sample?view=diff&rev=420211&r1=420210&r2=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/config.ini.sample (original)
+++ branches/12/contrib/ast-db-manage/config.ini.sample Wed Aug  6 11:51:49 2014
@@ -1,3 +1,5 @@
+# A generic, single database configuration.
+
 [alembic]
 # path to migration scripts
 script_location = config
@@ -5,11 +7,18 @@
 # template used to generate migration files
 # file_template = %%(rev)s_%%(slug)s
 
+# max length of characters to apply to the
+# "slug" field
+#truncate_slug_length = 40
+
 # set to 'true' to run the environment during
 # the 'revision' command, regardless of autogenerate
 # revision_environment = false
 
-sqlalchemy.url = mysql://root:password@localhost/asterisk
+#sqlalchemy.url = driver://user:pass@localhost/dbname
+
+#sqlalchemy.url = postgresql://user:pass@localhost/asterisk
+sqlalchemy.url = mysql://user:pass@localhost/asterisk
 
 
 # Logging configuration

Added: branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py?view=auto&rev=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py (added)
+++ branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py Wed Aug  6 11:51:49 2014
@@ -1,0 +1,41 @@
+#
+# Asterisk -- An open source telephony toolkit.
+#
+# Copyright (C) 2014, Richard Mudgett
+#
+# Richard Mudgett <rmudgett at digium.com>
+#
+# See http://www.asterisk.org for more information about
+# the Asterisk project. Please do not directly contact
+# any of the maintainers of this project for assistance;
+# the project provides a web site, mailing lists and IRC
+# channels for your use.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2. See the LICENSE file
+# at the top of the source tree.
+#
+
+"""increase useragent column size
+
+Revision ID: 1758e8bbf6b
+Revises: 1d50859ed02e
+Create Date: 2014-07-28 14:04:17.874332
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '1758e8bbf6b'
+down_revision = '1d50859ed02e'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    op.alter_column('sippeers', 'useragent', type_=sa.String(255))
+
+
+def downgrade():
+    op.alter_column('sippeers', 'useragent', type_=sa.String(20))
+

Propchange: branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/12/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: branches/12/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py?view=diff&rev=420211&r1=420210&r2=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py (original)
+++ branches/12/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py Wed Aug  6 11:51:49 2014
@@ -184,5 +184,6 @@
     op.drop_table('ps_endpoints')
     op.drop_table('ps_auths')
     op.drop_table('ps_aors')
+    op.drop_table('ps_contacts')
     op.drop_table('ps_domain_aliases')
     op.drop_table('ps_endpoint_id_ips')

Added: branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py?view=auto&rev=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py (added)
+++ branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py Wed Aug  6 11:51:49 2014
@@ -1,0 +1,60 @@
+#
+# Asterisk -- An open source telephony toolkit.
+#
+# Copyright (C) 2014, Richard Mudgett
+#
+# Richard Mudgett <rmudgett at digium.com>
+#
+# See http://www.asterisk.org for more information about
+# the Asterisk project. Please do not directly contact
+# any of the maintainers of this project for assistance;
+# the project provides a web site, mailing lists and IRC
+# channels for your use.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2. See the LICENSE file
+# at the top of the source tree.
+#
+
+"""make q member uniqueid autoinc
+
+Revision ID: 5139253c0423
+Revises: 1758e8bbf6b
+Create Date: 2014-07-29 16:26:51.184981
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '5139253c0423'
+down_revision = '1758e8bbf6b'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    # Was unable to find a way to use op.alter_column() to add the unique
+    # index property.
+    op.drop_column('queue_members', 'uniqueid')
+    op.add_column(
+        'queue_members',
+        sa.Column(
+            name='uniqueid', type_=sa.Integer, nullable=False,
+            unique=True))
+    # The postgres backend does not like the autoincrement needed for
+    # mysql here.  It is just the backend that is giving a warning and
+    # not the database itself.
+    op.alter_column(
+        table_name='queue_members', column_name='uniqueid',
+        existing_type=sa.Integer, existing_nullable=False,
+        autoincrement=True)
+
+
+def downgrade():
+    # Was unable to find a way to use op.alter_column() to remove the
+    # unique index property.
+    op.drop_column('queue_members', 'uniqueid')
+    op.add_column(
+        'queue_members',
+        sa.Column(name='uniqueid', type_=sa.String(80), nullable=False))
+

Propchange: branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/12/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: branches/12/contrib/ast-db-manage/voicemail.ini.sample
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/voicemail.ini.sample?view=diff&rev=420211&r1=420210&r2=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/voicemail.ini.sample (original)
+++ branches/12/contrib/ast-db-manage/voicemail.ini.sample Wed Aug  6 11:51:49 2014
@@ -1,3 +1,5 @@
+# A generic, single database configuration.
+
 [alembic]
 # path to migration scripts
 script_location = voicemail
@@ -5,10 +7,17 @@
 # template used to generate migration files
 # file_template = %%(rev)s_%%(slug)s
 
+# max length of characters to apply to the
+# "slug" field
+#truncate_slug_length = 40
+
 # set to 'true' to run the environment during
 # the 'revision' command, regardless of autogenerate
 # revision_environment = false
 
+#sqlalchemy.url = driver://user:pass@localhost/dbname
+
+#sqlalchemy.url = postgresql://user:pass@localhost/voicemail
 sqlalchemy.url = mysql://user:pass@localhost/voicemail
 
 

Added: branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py?view=auto&rev=420211
==============================================================================
--- branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py (added)
+++ branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py Wed Aug  6 11:51:49 2014
@@ -1,0 +1,44 @@
+#
+# Asterisk -- An open source telephony toolkit.
+#
+# Copyright (C) 2014, Richard Mudgett
+#
+# Richard Mudgett <rmudgett at digium.com>
+#
+# See http://www.asterisk.org for more information about
+# the Asterisk project. Please do not directly contact
+# any of the maintainers of this project for assistance;
+# the project provides a web site, mailing lists and IRC
+# channels for your use.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2. See the LICENSE file
+# at the top of the source tree.
+#
+
+"""increase recording column size
+
+Revision ID: 39428242f7f5
+Revises: a2e9769475e
+Create Date: 2014-07-28 16:02:05.104895
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '39428242f7f5'
+down_revision = 'a2e9769475e'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    # Make BLOB a LONGBLOB for mysql so recordings longer than about
+    # four seconds can be stored.
+    # See LargeBinary http://docs.sqlalchemy.org/en/rel_0_9/core/types.html
+    op.alter_column('voicemail_messages', 'recording', type_=sa.LargeBinary(4294967295))
+
+
+def downgrade():
+    op.alter_column('voicemail_messages', 'recording', type_=sa.LargeBinary)
+

Propchange: branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/12/contrib/ast-db-manage/voicemail/versions/39428242f7f5_increase_recording_column_size.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list