From e9614b7a433f364b75080fa1a86a9ccf6e6a3752 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 | 4 +++ ..._uuid_column_size_vcards_storage_table.php | 30 +++++++++++++++++++ 2 files changed, 34 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 422ffdb..ac78ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Flexisip Account Manager Changelog +v1.6.8 +--- +- Fix FLEXIAPI-375 Fix VcardsStorage table UUID size, recover the UUID from the stored vCard + v1.6.7 --- - Fix FLEXIAPI-367 Bump laravel-redis-sentinel dependency to support Redis 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(); + }); + } +};