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
0cbb17ce
Commit
0cbb17ce
authored
7 years ago
by
George Joseph
Browse files
Options
Downloads
Patches
Plain Diff
alembic: Fix enum creation for dtls_fingerprint
Change-Id: Ic061c5066a146616a68376881c7e4cf6d6e7e7db
parent
4b606c25
Branches
Branches containing commit
Tags
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/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py
+16
-1
16 additions, 1 deletion
...ions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py
with
16 additions
and
1 deletion
contrib/ast-db-manage/config/versions/b83645976fdd_add_dtls_fingerprint_to_ps_endpoints.py
+
16
−
1
View file @
0cbb17ce
...
...
@@ -14,10 +14,25 @@ from alembic import op
import
sqlalchemy
as
sa
from
sqlalchemy.dialects.postgresql
import
ENUM
SHA_HASH_NAME
=
'
sha_hash_values
'
SHA_HASH_VALUES
=
[
'
SHA-1
'
,
'
SHA-256
'
]
def
upgrade
():
op
.
add_column
(
'
ps_endpoints
'
,
sa
.
Column
(
'
dtls_fingerprint
'
,
sa
.
Enum
(
*
SHA_HASH_VALUES
,
name
=
'
sha_hash_values
'
)))
context
=
op
.
get_context
()
if
context
.
bind
.
dialect
.
name
==
'
postgresql
'
:
enum
=
ENUM
(
*
SHA_HASH_VALUES
,
name
=
SHA_HASH_NAME
)
enum
.
create
(
op
.
get_bind
(),
checkfirst
=
False
)
op
.
add_column
(
'
ps_endpoints
'
,
sa
.
Column
(
'
dtls_fingerprint
'
,
ENUM
(
*
SHA_HASH_VALUES
,
name
=
SHA_HASH_NAME
,
create_type
=
False
)))
def
downgrade
():
context
=
op
.
get_context
()
op
.
drop_column
(
'
ps_endpoints
'
,
'
dtls_fingerprint
'
)
if
context
.
bind
.
dialect
.
name
==
'
postgresql
'
:
enum
=
ENUM
(
*
SHA_HASH_VALUES
,
name
=
SHA_HASH_NAME
)
enum
.
drop
(
op
.
get_bind
(),
checkfirst
=
False
)
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