mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix FLEXIAPI-375 Fix VcardsStorage table UUID size, recover the UUID from the stored vCard
This commit is contained in:
parent
427652327e
commit
e9614b7a43
2 changed files with 34 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use App\VcardStorage;
|
||||
use Sabre\VObject;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('vcards_storage', function (Blueprint $table) {
|
||||
$table->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();
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue