-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
MySQL 8: SQL Error on Database Migration, IF EXISTS not supported #1764
Comments
Oh wow, MySQL supports Related to: As a workaround, you can manually run these statements without https://github.com/photoprism/photoprism/tree/develop/internal/migrate/mysql Not happy we need to spend time writing complicated special migrations for MySQL 8. Indexes were created by the ORM in earlier versions, so we don't know 100% what the actual name is. |
Would it be an option to use MariaDB 10.6 instead? Any features only MySQL 8 has? |
Guess we could also ignore errors in the migration package if it's a drop statements, however that's dangerous as there can be other errors like invalid SQL too. |
Thank you for your help. Only one of these three indexes existed. As the only migration steps were index drops, I don't think this is critical. I was worried that other DB changes were missing and PhotoPrism might not work as intended. |
It's critical in that the column is NOT UNIQUE anymore. So you will get INSERT / UPDATE errors when updating places. |
Should be "fixed" with this: 7e8974f |
Started a new Development Preview build for testing! Should be available within the next hour... |
see photoprism/photoprism#1764 Signed-off-by: Michael Mayer <michael@photoprism.app>
Updated the System Requirements as we currently don't have time to run all tests on MySQL 8 before every release: Let us know when you run into issues and we do our best to help. |
New Development Preview has been uploaded to Docker Hub. |
Released the fix. Hope it works for everyone. |
I've switched from MySQL to MariaDB for PhotoPrism. Thank you for your help and timely response. |
@lastzero I have this exactly same error with release photoprism:220527-jammy
|
With MySQL 8? It's not supported anymore, see docs. |
Aha, didn't know that. Sorry! |
Requires too many resources to completely test every release and add workarounds for MySQL 8, especially since we noticed that only very few users are (still) using it and can't upgrade.... |
Updating from photoprism/photoprism 212018 docker image to 211127, the database migration fails with the following errors:
time="2021-11-28T05:10:21Z" level=error msg="migration 20211121-094727 failed: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS uix_places_place_label ON
places
' at line 1 [3.510832ms]"time="2021-11-28T05:10:21Z" level=error msg="migration 20211124-120008 failed: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS idx_places_place_label ON
places
' at line 1 [2.024121ms]"Database: MySQL 8.0.27
The text was updated successfully, but these errors were encountered: