[Asterisk-code-review] app_queue: Add alembic migration to add ringinuse to queue_members. (asterisk[16])

Friendly Automation asteriskteam at digium.com
Tue Mar 30 04:41:27 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15697 )

Change subject: app_queue: Add alembic migration to add ringinuse to queue_members.
......................................................................

app_queue: Add alembic migration to add ringinuse to queue_members.

ASTERISK-28356 #close

Change-Id: I53a1bfdd3113d620bea88349019173a2f3f0ae39
---
A contrib/ast-db-manage/config/versions/8915fcc5766f_add_ringinuse_to_queue_members.py
1 file changed, 30 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit



diff --git a/contrib/ast-db-manage/config/versions/8915fcc5766f_add_ringinuse_to_queue_members.py b/contrib/ast-db-manage/config/versions/8915fcc5766f_add_ringinuse_to_queue_members.py
new file mode 100644
index 0000000..34b84e4
--- /dev/null
+++ b/contrib/ast-db-manage/config/versions/8915fcc5766f_add_ringinuse_to_queue_members.py
@@ -0,0 +1,30 @@
+"""Add ringinuse to queue_members
+
+Revision ID: 8915fcc5766f
+Revises: 61797b9fced6
+Create Date: 2021-03-24 09:28:46.901447
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '8915fcc5766f'
+down_revision = '61797b9fced6'
+
+from alembic import op
+import sqlalchemy as sa
+from sqlalchemy.dialects.postgresql import ENUM
+
+AST_BOOL_NAME = 'ast_bool_values'
+AST_BOOL_VALUES = [ '0', '1',
+                    'off', 'on',
+                    'false', 'true',
+                    'no', 'yes' ]
+
+def upgrade():
+    ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
+    op.add_column('queue_members', sa.Column('ringinuse', ast_bool_values))
+
+def downgrade():
+    if op.get_context().bind.dialect.name == 'mssql':
+        op.drop_constraint('ck_queue_members_ringinuse_ast_bool_values', 'queue_members')
+    op.drop_column('queue_members', 'ringinuse')

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15697
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I53a1bfdd3113d620bea88349019173a2f3f0ae39
Gerrit-Change-Number: 15697
Gerrit-PatchSet: 5
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210330/0b06afc3/attachment.html>


More information about the asterisk-code-review mailing list