<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6434">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">alembic: Fix enum creation for dtls_fingerprint<br><br>Change-Id: Ic061c5066a146616a68376881c7e4cf6d6e7e7db<br>---<br>M contrib/ast-db-manage/config/versions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py<br>1 file changed, 16 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/34/6434/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/contrib/ast-db-manage/config/versions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py b/contrib/ast-db-manage/config/versions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py<br>index 962ec7a..74e01a7 100644<br>--- a/contrib/ast-db-manage/config/versions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py<br>+++ b/contrib/ast-db-manage/config/versions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py<br>@@ -14,10 +14,25 @@<br> import sqlalchemy as sa<br> from sqlalchemy.dialects.postgresql import ENUM<br> <br>+SHA_HASH_NAME = 'sha_hash_values'<br> SHA_HASH_VALUES = ['SHA-1', 'SHA-256']<br> <br> def upgrade():<br>- op.add_column('ps_endpoints', sa.Column('dtls_fingerprint', sa.Enum(*SHA_HASH_VALUES, name='sha_hash_values')))<br>+ context = op.get_context()<br>+<br>+ if context.bind.dialect.name == 'postgresql':<br>+ enum = ENUM(*SHA_HASH_VALUES, name=SHA_HASH_NAME)<br>+ enum.create(op.get_bind(), checkfirst=False)<br>+<br>+ op.add_column('ps_endpoints',<br>+ sa.Column('dtls_fingerprint', ENUM(*SHA_HASH_VALUES,<br>+ name=SHA_HASH_NAME, create_type=False)))<br> <br> def downgrade():<br>+ context = op.get_context()<br>+<br> op.drop_column('ps_endpoints', 'dtls_fingerprint')<br>+<br>+ if context.bind.dialect.name == 'postgresql':<br>+ enum = ENUM(*SHA_HASH_VALUES, name=SHA_HASH_NAME)<br>+ enum.drop(op.get_bind(), checkfirst=False)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6434">change 6434</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6434"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15.0 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic061c5066a146616a68376881c7e4cf6d6e7e7db </div>
<div style="display:none"> Gerrit-Change-Number: 6434 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>