Sylius: [RFC] Consider replacing DB DC2TYPE:array with json_array app wide

Created on 11 May 2018  路  7Comments  路  Source: Sylius/Sylius

| Q | A
| ---------------- | -----
| Bug report? | no
| Feature request? | yes
| BC Break report? | not sure
| RFC? | yes
| Sylius version | 1.x.y

Hi,

Problem is that array field type is not query-able, but json_array can be accessed via native functions and extensions like https://github.com/SyslogicNL/DoctrineJsonFunctions

So as far as I know, DB field type array can be switched to json_array without any BC in codebase (Don't really know).

My use case is where I need to pull promotion with specific rule configuration from DB, with json_array it can be done in more civil manner, than regexping configuration field.

+----+--------------+--------------------------------------------+------------------------------------------------+
| id | promotion_id | type | configuration |
+----+--------------+--------------------------------------------+------------------------------------------------+
| 1 | 1 | cart_quantity | a:1:{s:5:"count";i:100;} |

Are there downfalls beside BC for existing DB? I'm not sure.

Cheers.

Do not stale RFC

All 7 comments

I'm for it if we can provide migrations (and in the best case scenario - tests for these migrations).

The correct type should be json as the json_array type has been deprecated since Doctrine DBAL 2.6

This change will block us from using MariaDB, and therefore platform.sh which has only MariaDB as MySQL instance :(

Why would it block from using MariaDB? I don't understand. Doctrine DBAL supports MariaDB.

Ok, my bad. They have json type as a long text... It will work then, but not as expected

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

Not stale.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

javiereguiluz picture javiereguiluz  路  3Comments

igormukhingmailcom picture igormukhingmailcom  路  3Comments

loic425 picture loic425  路  3Comments

stefandoorn picture stefandoorn  路  3Comments

Chrysweel picture Chrysweel  路  3Comments