Skip to content

Commit

Permalink
Upgrade example using JSON_EXTRACT (spatie#2970)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Jun 29, 2022
1 parent a45a043 commit f64d461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AddGeneratedConversionsToMediaTable extends Migration {
})
->whereRaw("JSON_LENGTH(custom_properties) > 0")
->update([
'generated_conversions' => DB::raw('custom_properties->"$.generated_conversions"'),
'generated_conversions' => DB::raw("JSON_EXTRACT(custom_properties, '$.generated_conversions')"),
// OPTIONAL: Remove the generated conversions from the custom_properties field as well:
// 'custom_properties' => DB::raw("JSON_REMOVE(custom_properties, '$.generated_conversions')")
]);
Expand Down

0 comments on commit f64d461

Please sign in to comment.