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
e0a9b75923
commit
ee2c9fed8f
2 changed files with 31 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ v2.1
|
|||
- Fix FLEXIAPI-359 Add CardDav servers support in the spaces
|
||||
- Fix FLEXIAPI-374 Improve CardDav credentials form
|
||||
- Fix FLEXIAPI-376 Rename domain to realm in CardDav credentials
|
||||
- Fix FLEXIAPI-375 Fix VcardsStorage table UUID size, recover the UUID from the stored vCard
|
||||
|
||||
v2.0
|
||||
----
|
||||
|
|
|
|||
|
|
@ -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