Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrations fail for database name containing "-" #4664

Closed
stanislav-brabec opened this issue Oct 8, 2020 · 2 comments · Fixed by #4665
Closed

migrations fail for database name containing "-" #4664

stanislav-brabec opened this issue Oct 8, 2020 · 2 comments · Fixed by #4665
Assignees
Labels
bug Something is broken.
Milestone

Comments

@stanislav-brabec
Copy link
Contributor

Describe the bug
Applying memory.0007_use_trigram...Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.SyntaxError: syntax error at or near "-"
LINE 1: ALTER DATABASE weblate-staging SET pg_trgm.similarity_thresh...
^
To Reproduce
Set the database name to "weblate-staging"

I worked around this by changing of
ALTER DATABASE {} SET
to
ALTER DATABASE "{}" SET
in 0007_use_trigram.py and 0008_adjust_similarity.py.

weblate-4.1.1

@nijel nijel added the bug Something is broken. label Oct 8, 2020
@nijel nijel added this to the 4.3 milestone Oct 8, 2020
@nijel nijel self-assigned this Oct 8, 2020
@nijel
Copy link
Member

nijel commented Oct 8, 2020

Weblate 4.2 has changed this to role based, see bbf6f11 and #3940, but the problem could exist there as well.

@kodiakhq kodiakhq bot closed this as completed in #4665 Oct 8, 2020
kodiakhq bot pushed a commit that referenced this issue Oct 8, 2020
@github-actions
Copy link

github-actions bot commented Oct 8, 2020

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants