refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s

This commit is contained in:
Kroonk
2026-05-22 16:19:55 +02:00
parent 38cc4c09ca
commit a213a1dba0
2215 changed files with 242567 additions and 6015 deletions

View File

@@ -0,0 +1,79 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddUuids extends Migration
{
/**
* @var array
*/
private $tables = [
'accounts',
'users',
'activities',
'activity_types',
'activity_type_categories',
'contact_field_types',
'photos',
'documents',
'life_events',
'life_event_categories',
'life_event_types',
'addresses',
'addressbooks',
'addressbook_subscriptions',
'entries',
'days',
'calls',
'contact_fields',
'conversations',
'debts',
'gifts',
'messages',
'notes',
'pets',
'reminders',
'relationships',
'genders',
];
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
foreach ($this->tables as $name) {
if (! Schema::hasColumn($name, 'uuid')) {
Schema::table($name, function (Blueprint $table) use ($name) {
$table->uuid('uuid')->after('id')->nullable();
$table->index($name === 'accounts' ? ['uuid'] : ['account_id', 'uuid']);
});
}
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
foreach ($this->tables as $name) {
if (Schema::hasColumn($name, 'uuid')) {
Schema::table($name, function (Blueprint $table) use ($name) {
try {
$table->dropIndex($name === 'accounts' ? ['uuid'] : ['account_id', 'uuid']);
$table->dropColumn('uuid');
} catch (\Exception $e) {
//
}
});
}
}
}
}