From 7e9d34cf0b574d6263103e906c468f0869830f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Wed, 27 Aug 2025 16:29:47 +0200 Subject: [PATCH] Fix FLEXIAPI-375 Fix VcardsStorage table UUID size, recover the UUID from the stored vCard --- CHANGELOG.md | 1 + ..._uuid_column_size_vcards_storage_table.php | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 flexiapi/database/migrations/2025_08_27_142250_change_uuid_column_size_vcards_storage_table.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d83cc58..e6f0b3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ v2.0 - Fix FLEXIAPI-364 Fix a faulty redirection in the ExternalAccount controller - Fix FLEXIAPI-361 Prepare the 2.0 release - Fix FLEXIAPI-372 Remove SESSION_DRIVER and CACHE_DRIVER and enforce them to file +- Fix FLEXIAPI-375 Fix VcardsStorage table UUID size, recover the UUID from the stored vCard v1.6 ---- diff --git a/flexiapi/database/migrations/2025_08_27_142250_change_uuid_column_size_vcards_storage_table.php b/flexiapi/database/migrations/2025_08_27_142250_change_uuid_column_size_vcards_storage_table.php new file mode 100644 index 0000000..294ed59 --- /dev/null +++ b/flexiapi/database/migrations/2025_08_27_142250_change_uuid_column_size_vcards_storage_table.php @@ -0,0 +1,30 @@ +string('uuid', 45)->change(); + }); + + foreach (VcardStorage::all() as $vcardStorage) { + $vcard = VObject\Reader::read($vcardStorage->vcard); + $vcardStorage->uuid = $vcard->UID; + $vcardStorage->save(); + } + } + + public function down(): void + { + Schema::table('vcards_storage', function (Blueprint $table) { + $table->string('uuid', 36)->change(); + }); + } +};