Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
c7528f16
Commit
c7528f16
authored
6 years ago
by
Richard Mudgett
Browse files
Options
Downloads
Patches
Plain Diff
alembic: Fix use_callerid_contact option add script.
ASTERISK-28087 Change-Id: I046d018015427d0916fab571b5a4f5367476f729
parent
584e08b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/ast-db-manage/config/versions/2bb1a85135ad_pjsip_add_use_callerid_contact.py
+10
-5
10 additions, 5 deletions
...g/versions/2bb1a85135ad_pjsip_add_use_callerid_contact.py
with
10 additions
and
5 deletions
contrib/ast-db-manage/config/versions/2bb1a85135ad_pjsip_add_use_callerid_contact.py
+
10
−
5
View file @
c7528f16
...
...
@@ -14,21 +14,26 @@ from alembic import op
import
sqlalchemy
as
sa
from
sqlalchemy.dialects.postgresql
import
ENUM
YESNO_NAME
=
'
yesno_values
'
YESNO_VALUES
=
[
'
yes
'
,
'
no
'
]
AST_BOOL_NAME
=
'
ast_bool_values
'
# We'll just ignore the n/y and f/t abbreviations as Asterisk does not write
# those aliases.
AST_BOOL_VALUES
=
[
'
0
'
,
'
1
'
,
'
off
'
,
'
on
'
,
'
false
'
,
'
true
'
,
'
no
'
,
'
yes
'
]
def
upgrade
():
############################# Enums ##############################
#
yesno
_values ha
ve
already been created, so use postgres enum object
#
ast_bool
_values ha
s
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
)
ast_bool
_values
=
ENUM
(
*
AST_BOOL
_VALUES
,
name
=
AST_BOOL
_NAME
,
create_type
=
False
)
op
.
add_column
(
'
ps_globals
'
,
sa
.
Column
(
'
use_callerid_contact
'
,
yesno_values
))
def
downgrade
():
if
op
.
get_context
().
bind
.
dialect
.
name
==
'
mssql
'
:
op
.
drop_constraint
(
'
ck_ps_globals_use_callerid_contact_
yesno
_values
'
,
'
ps_globals
'
)
op
.
drop_constraint
(
'
ck_ps_globals_use_callerid_contact_
ast_bool
_values
'
,
'
ps_globals
'
)
op
.
drop_column
(
'
ps_globals
'
,
'
use_callerid_contact
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment