kea
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-15 02:48:23 +02:00
parent 7157c98dcb
commit 598348a4b6
8 changed files with 532 additions and 11 deletions

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
use App\Database;
use App\ModuleMigrationContext;
use App\Repository\KeaHostMetadataRepository;
return new class {
public function up(ModuleMigrationContext $context): void
{
$settings = $context->settings();
$fallback = is_array($context->module['metadata_db_defaults'] ?? null)
? $context->module['metadata_db_defaults']
: [];
$config = is_array($settings['metadata_db'] ?? null)
? array_replace($fallback, $settings['metadata_db'])
: $fallback;
if (empty($config['driver']) || empty($config['dbname'])) {
return;
}
$repo = new KeaHostMetadataRepository(Database::createFromArray($config));
$repo->ensureSchema();
}
};