-
Notifications
You must be signed in to change notification settings - Fork 51
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
Feat array contains #335
Feat array contains #335
Conversation
src/Database/Adapter/MariaDB.php
Outdated
@@ -218,7 +218,7 @@ public function createAttribute(string $collection, string $id, string $type, in | |||
$type = $this->getSQLType($type, $size, $signed); | |||
|
|||
if ($array) { | |||
$type = 'LONGTEXT'; | |||
$type = 'JSON'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will have to migrate this on Appwrite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Just saw on MariaDB when trying to create a JSON attribute, It creates this:
genres longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(genres))
While in Mysql it is really a JSON field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm so we won't need a migration for MariaDB but will for MySQL.. this is a new problem 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can save it as Text + create a key / value Collection for search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…-contains � Conflicts: � bin/tasks/load.php � src/Database/Adapter/Postgres.php � tests/Database/QueryTest.php
Query::contains