0efefa2fda38c9e84592cb24c2c2613b74232905
[asterisk/asterisk.git] / contrib / ast-db-manage / config / versions / b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py
1 """add dtls_fingerprint to ps_endpoints
2
3 Revision ID: b83645976fdd
4 Revises: f3d1c5d38b56
5 Create Date: 2017-08-03 09:01:49.558111
6
7 """
8
9 # revision identifiers, used by Alembic.
10 revision = 'b83645976fdd'
11 down_revision = 'f3d1c5d38b56'
12
13 from alembic import op
14 import sqlalchemy as sa
15 from sqlalchemy.dialects.postgresql import ENUM
16
17 SHA_HASH_VALUES = ['SHA-1', 'SHA-256']
18
19 def upgrade():
20     op.add_column('ps_endpoints', sa.Column('dtls_fingerprint', sa.Enum(*SHA_HASH_VALUES, name='sha_hash_values')))
21
22 def downgrade():
23     op.drop_column('ps_endpoints', 'dtls_fingerprint')