[Asterisk-code-review] pjsip/alembic: Add disable tcp switch to ps systems (asterisk[master])

George Joseph asteriskteam at digium.com
Wed Feb 3 14:33:18 CST 2016


George Joseph has uploaded a new change for review.

  https://gerrit.asterisk.org/2192

Change subject: pjsip/alembic:  Add disable_tcp_switch to ps_systems
......................................................................

pjsip/alembic:  Add disable_tcp_switch to ps_systems

Was just missing

Change-Id: Iaf9c2d69e62243d9fa53104c28c5339c47d4ac19
---
A contrib/ast-db-manage/config/versions/dbc44d5a908_add_disable_tcp_switch_to_ps_systems.py
1 file changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/92/2192/1

diff --git a/contrib/ast-db-manage/config/versions/dbc44d5a908_add_disable_tcp_switch_to_ps_systems.py b/contrib/ast-db-manage/config/versions/dbc44d5a908_add_disable_tcp_switch_to_ps_systems.py
new file mode 100644
index 0000000..47a72f3
--- /dev/null
+++ b/contrib/ast-db-manage/config/versions/dbc44d5a908_add_disable_tcp_switch_to_ps_systems.py
@@ -0,0 +1,33 @@
+"""Add disable_tcp_switch to ps_systems
+
+Revision ID: dbc44d5a908
+Revises: 423f34ad36e2
+Create Date: 2016-02-03 13:15:15.083043
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = 'dbc44d5a908'
+down_revision = '423f34ad36e2'
+
+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_systems', sa.Column('disable_tcp_switch', yesno_values))
+    pass
+
+
+def downgrade():
+    op.drop_column('ps_systems', 'disable_tcp_switch')
+    pass

-- 
To view, visit https://gerrit.asterisk.org/2192
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf9c2d69e62243d9fa53104c28c5339c47d4ac19
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>



More information about the asterisk-code-review mailing list