server icon indicating copy to clipboard operation
server copied to clipboard

Fix dav properties column types

Open tcitworld opened this issue 2 years ago • 2 comments

Summary

  • First commit changes column propertyvalue from TEXT type to BLOB as it may contain null 0x00 characters because of php serialization #37754
    • after removing all serialized data (that have very good chances to be invalid)
    • by creating a new temporary column
    • moving data to it
    • dropping the old column
    • adding a new column with the right type
    • moving data to it
    • resetting not null on the new column
    • dropping the temporary column
  • Second one increases simply propertypath column length #9907

If changing the type of the column can't be done, we'll need to create a new column and move data

TODO

  • [x] SQLite is accepting pretty much anything ✅
  • [x] MySQL/MariaDB ✅ just needs the index to be on a prefix
  • [x] Test on PostgreSQL ❌ (needs some cast magic)
  • [x] Test on Oracle ❌ (is being Oracle)

Checklist

tcitworld avatar Jun 30 '23 09:06 tcitworld

@skjnldsv This one is important and I need some help on the database migration.

tcitworld avatar Aug 26 '24 15:08 tcitworld

Any chance this PR get's some love?

rakekniven avatar Oct 11 '24 15:10 rakekniven

For PostgreSQL : https://stackoverflow.com/questions/19300113/unable-to-convert-postgresql-text-column-to-bytea For Oracle : https://asktom.oracle.com/ords/f?p=100:11:::::P11_QUESTION_ID:510622111991

If we have less than 50k rows (value yet to determine), perform the migrations straight away. Otherwise, skip the migration, set an appconfig and add a red flag in system check. Then include as an expensive repair step.

tcitworld avatar Oct 15 '24 08:10 tcitworld

Fixed through https://github.com/nextcloud/server/pull/49528

tcitworld avatar Aug 26 '25 07:08 tcitworld