-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Migrate metadata JSON column to new value TEXT column #37146
Conversation
/backport to stable26 |
d74d606
to
3481821
Compare
@@ -52,11 +52,14 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt | |||
'notnull' => true, | |||
'length' => 50, | |||
]); | |||
$table->addColumn('metadata', Types::JSON, [ | |||
$table->addColumn('value', Types::STRING, [ |
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 to simply edit the column, instead of commenting the migration and creating new one ?
12753e3
to
9d238b3
Compare
why |
@nickvergessen i recall, |
No reason, why use one over the other ? |
String is limited to 4000 chars IIRC |
Still, the question on distinct? |
d805c04
to
0f882bc
Compare
Squashed, any other comments ? |
Ping :) |
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
Autoloaders seem to not be up-to-date? |
0f882bc
to
5a79e56
Compare
Indeed, fixed :) |
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.
Looks good, did not test it.
Signed-off-by: Louis Chemineau <[email protected]>
5a79e56
to
1a6709c
Compare
CI failure unrelated |
Gnaa. This breaks recognize: nextcloud/recognize#806 |
Hahh. I'm looking into fixing recognize on my instance and I landed here. Has anyone got a suggestion? |
|
oc_files_metadata.metadata
is created asTypes::JSON
. Beside not bringing any advantages, this creates the limitation of not being able to use theDISTINCT
operator on it when using PostgreSQL.The
DISTINCT
operator is for example used by photos: https://github.com/nextcloud/photos/blob/65d222db10ab5f005125d56576b8bd223b4dd054/lib/DB/Place/PlaceMapper.php#L56This PR migrates the
metadata
column to a newvalue
column asTypes:STRING
It also renames and adapt the code accordingly.
Photos PR to adjust: nextcloud/photos#1692
Tested both on fresh install and after a migration.