Asterisk - The Open Source Telephony Project
GIT-master-3dee037
contrib
ast-db-manage
config
versions
44bd6dd914fa_add_qualify_2xx_only_option.py
Go to the documentation of this file.
1
"""add qualify 2xx only option
2
3
Revision ID: 44bd6dd914fa
4
Revises: 4f91fc18c979
5
Create Date: 2024-12-02 21:08:41.130023
6
7
"""
8
9
# revision identifiers, used by Alembic.
10
revision =
'44bd6dd914fa'
11
down_revision =
'4f91fc18c979'
12
13
from
alembic
import
op
14
import
sqlalchemy
as
sa
15
from
sqlalchemy.dialects.postgresql
import
ENUM
16
17
AST_BOOL_NAME =
'ast_bool_values'
18
AST_BOOL_VALUES = [
'0'
,
'1'
,
19
'off'
,
'on'
,
20
'false'
,
'true'
,
21
'no'
,
'yes'
]
22
23
def
upgrade
():
24
ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=
False
)
25
op.add_column(
'ps_aors'
, sa.Column(
'qualify_2xx_only'
, ast_bool_values))
26
op.add_column(
'ps_contacts'
, sa.Column(
'qualify_2xx_only'
, ast_bool_values))
27
28
29
def
downgrade
():
30
if
op.get_context().bind.dialect.name ==
'mssql'
:
31
op.drop_constraint(
'ck_ps_aors_qualify_2xx_only_ast_bool_values'
,
'ps_aors'
)
32
op.drop_constraint(
'ck_ps_contacts_qualify_2xx_only_ast_bool_values'
,
'ps_contacts'
)
33
op.drop_column(
'ps_aors'
,
'qualify_2xx_only'
)
34
op.drop_column(
'ps_contacts'
,
'qualify_2xx_only'
)
44bd6dd914fa_add_qualify_2xx_only_option.upgrade
def upgrade()
Definition:
44bd6dd914fa_add_qualify_2xx_only_option.py:23
44bd6dd914fa_add_qualify_2xx_only_option.downgrade
def downgrade()
Definition:
44bd6dd914fa_add_qualify_2xx_only_option.py:29
Generated on Wed Jan 1 2025 20:04:22 for Asterisk - The Open Source Telephony Project by
1.9.4