Asterisk - The Open Source Telephony Project GIT-master-f36a736
bd335bae5d33_create_stir_shaken_tn_table.py
Go to the documentation of this file.
1"""Create STIR/SHAKEN TN table
2
3Revision ID: bd335bae5d33
4Revises: 24c12d8e9014
5Create Date: 2024-01-09 12:17:47.353533
6
7"""
8
9# revision identifiers, used by Alembic.
10revision = 'bd335bae5d33'
11down_revision = '24c12d8e9014'
12
13from alembic import op
14import sqlalchemy as sa
15from sqlalchemy.dialects.postgresql import ENUM
16
17AST_BOOL_NAME = 'ast_bool_values'
18AST_BOOL_VALUES = [ '0', '1',
19 'off', 'on',
20 'false', 'true',
21 'no', 'yes' ]
22
23def upgrade():
24 ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
25 op.create_table(
26 'stir_tn',
27 sa.Column('id', sa.String(80), nullable=False, primary_key=True),
28 sa.Column('private_key_file', sa.String(1024), nullable=True),
29 sa.Column('public_cert_url', sa.String(1024), nullable=True),
30 sa.Column('attest_level', sa.String(1), nullable=True),
31 sa.Column('send_mky', ast_bool_values)
32 )
33
35 op.drop_table('stir_tn')