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

MariaDb issue when upgrading from v8 to v9 #2969

Closed
lcresswell opened this issue Jun 29, 2022 · 1 comment · Fixed by #2970
Closed

MariaDb issue when upgrading from v8 to v9 #2969

lcresswell opened this issue Jun 29, 2022 · 1 comment · Fixed by #2970

Comments

@lcresswell
Copy link

lcresswell commented Jun 29, 2022

I ran into an issue when upgrading from v8 to v9 when using a Mariadb database. I was getting
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>"$.generated_conversions", media.updated_at = ? where (generated_conver...' at line 1 (SQL: update media set generated_conversions = custom_properties->"$.generated_conversions", media.updated_at = 2022-06-29 08:04:38 where (generated_conversions is null or generated_conversions = or JSON_TYPE(generated_conversions) = 'NULL') and JSON_LENGTH(custom_properties) > 0)`
when I added the AddGeneratedConversionsToMediaTable migration.

The solution in the end was to edit the migration file, line 31.

Change
'generated_conversions' => DB::raw('custom_properties->"$.generated_conversions")
To
'generated_conversions' => DB::raw('JSON_EXTRACT(custom_properties, "$.generated_conversions")')

Think this could possibly be added to the docs as anyone using a MariaDb database will run into this issue.

@angeljqv
Copy link
Contributor

It is not possible to put an example for each db and for each db version, the file is an example that you must adapt to your needs

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

Successfully merging a pull request may close this issue.

2 participants