[Asterisk-code-review] Add prune contacts alembic script to 15.0 (asterisk[15.0])
George Joseph
asteriskteam at digium.com
Wed Sep 6 11:17:55 CDT 2017
George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/6435
Change subject: Add prune contacts alembic script to 15.0
......................................................................
Add prune contacts alembic script to 15.0
Change-Id: I4d1c14cdbffefdb5a62f735a80613ea5bb38dba6
---
A contrib/ast-db-manage/config/versions/f3d1c5d38b56_add_prune_on_boot.py
1 file changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/35/6435/1
diff --git a/contrib/ast-db-manage/config/versions/f3d1c5d38b56_add_prune_on_boot.py b/contrib/ast-db-manage/config/versions/f3d1c5d38b56_add_prune_on_boot.py
new file mode 100644
index 0000000..fe9c35e
--- /dev/null
+++ b/contrib/ast-db-manage/config/versions/f3d1c5d38b56_add_prune_on_boot.py
@@ -0,0 +1,28 @@
+"""add_prune_on_boot
+
+Revision ID: f3d1c5d38b56
+Revises: 44ccced114ce
+Create Date: 2017-08-04 17:31:23.124767
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = 'f3d1c5d38b56'
+down_revision = '44ccced114ce'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+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_contacts', sa.Column('prune_on_boot', yesno_values))
+
+
+def downgrade():
+ op.drop_column('ps_contacts', 'prune_on_boot')
--
To view, visit https://gerrit.asterisk.org/6435
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15.0
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d1c14cdbffefdb5a62f735a80613ea5bb38dba6
Gerrit-Change-Number: 6435
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170906/ee92ff4b/attachment-0001.html>
More information about the asterisk-code-review
mailing list