Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale_OLD
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jovuit
funkwhale_OLD
Commits
079c6662
Verified
Commit
079c6662
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix #663: Do not try to create unaccent extension if it's already present
parent
e44b9e04
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/common/migrations/0001_initial.py
+13
-1
13 additions, 1 deletion
api/funkwhale_api/common/migrations/0001_initial.py
changes/changelog.d/663.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/663.bugfix
with
14 additions
and
1 deletion
api/funkwhale_api/common/migrations/0001_initial.py
+
13
−
1
View file @
079c6662
...
...
@@ -3,8 +3,20 @@ from django.db import migrations
from
django.contrib.postgres.operations
import
UnaccentExtension
class
CustomUnaccentExtension
(
UnaccentExtension
):
def
database_forwards
(
self
,
app_label
,
schema_editor
,
from_state
,
to_state
):
check_sql
=
"
SELECT 1 FROM pg_extension WHERE extname =
'
unaccent
'"
with
schema_editor
.
connection
.
cursor
()
as
cursor
:
cursor
.
execute
(
check_sql
)
result
=
cursor
.
fetchall
()
if
result
:
return
return
super
().
database_forwards
(
app_label
,
schema_editor
,
from_state
,
to_state
)
class
Migration
(
migrations
.
Migration
):
dependencies
=
[]
operations
=
[
UnaccentExtension
()]
operations
=
[
Custom
UnaccentExtension
()]
This diff is collapsed.
Click to expand it.
changes/changelog.d/663.bugfix
0 → 100644
+
1
−
0
View file @
079c6662
Do not try to create unaccent extension if it's already present (#663)
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