Skip to content

Commit

Permalink
Use jsonb to avoid problems on batch delete (#2267)
Browse files Browse the repository at this point in the history
* Use jsonb to avoid problems on batch delete

* Add upgrade note
  • Loading branch information
jordisala1991 authored Jan 24, 2022
1 parent 4dc5f6a commit 3c5f798
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Assuming your media table is called `media__media`, you could execute:
UPDATE media__media SET cdnIsFlushable = false WHERE cdnIsFlushable IS NULL;
```

We also added an option to use `jsonb` for the `providerMetadata` field. This will only affect you if you use PostgreSQL
database. Please make sure you do the appropiate changes to your schema in order to be in sync.

### Removed unused JavaScript

SonataMediaBundle 3 included a JavaScript dependency: Nivo Gallery. This dependency is not used on Sonata code,
Expand Down
6 changes: 5 additions & 1 deletion src/Resources/config/doctrine/BaseMedia.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<field name="providerName" column="provider_name" type="string" length="255"/>
<field name="providerStatus" column="provider_status" type="integer"/>
<field name="providerReference" column="provider_reference" type="string" length="255"/>
<field name="providerMetadata" column="provider_metadata" type="json" nullable="true"/>
<field name="providerMetadata" column="provider_metadata" type="json" nullable="true">
<options>
<option name="jsonb">true</option>
</options>
</field>
<field name="width" column="width" type="integer" nullable="true"/>
<field name="height" column="height" type="integer" nullable="true"/>
<field name="length" column="length" type="decimal" nullable="true"/>
Expand Down

0 comments on commit 3c5f798

Please sign in to comment.