Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
AF
Hiboo
Commits
2ef941fa
Commit
2ef941fa
authored
5 months ago
by
ornanovitch
Browse files
Options
Downloads
Plain Diff
Merge branch '145-keyerror-a-la-creation-d-un-nouveau-profile' into 'dev'
fix: KeyError at profile creation Closes
#145
See merge request
!93
parents
cc06e6f9
5b651841
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
migrations/versions/0147b747696e_set_default_service_profile_format.py
+46
-0
46 additions, 0 deletions
...rsions/0147b747696e_set_default_service_profile_format.py
with
46 additions
and
0 deletions
migrations/versions/0147b747696e_set_default_service_profile_format.py
0 → 100644
+
46
−
0
View file @
2ef941fa
"""
update and set empty service.profile_format to server_default
'
lowercase
'
Revision ID: 0147b747696e
Revises: f9130c1a10f7
Create Date: 2024-09-30 18:10:42.200989
"""
from
alembic
import
op
import
sqlalchemy
as
sa
import
hiboo
revision
=
"
0147b747696e
"
down_revision
=
"
f9130c1a10f7
"
branch_labels
=
None
depends_on
=
None
service_table
=
sa
.
Table
(
"
service
"
,
sa
.
MetaData
(),
sa
.
Column
(
"
profile_format
"
,
sa
.
String
(
length
=
255
))
)
def
upgrade
():
with
op
.
batch_alter_table
(
"
service
"
)
as
batch_op
:
batch_op
.
alter_column
(
"
profile_format
"
,
existing_type
=
sa
.
String
(
length
=
255
),
server_default
=
"
lowercase
"
,
nullable
=
False
,
)
connection
=
op
.
get_bind
()
connection
.
execute
(
service_table
.
update
()
.
where
(
service_table
.
c
.
profile_format
==
""
)
.
values
(
profile_format
=
"
lowercase
"
)
)
def
downgrade
():
with
op
.
batch_alter_table
(
"
service
"
)
as
batch_op
:
batch_op
.
alter_column
(
"
profile_format
"
,
existing_type
=
sa
.
String
(
length
=
255
),
server_default
=
None
,
nullable
=
True
,
)
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