feat: seed eBay platform row via migration
Some checks are pending
CI / test (push) Waiting to run

INSERT INTO app.platforms WHERE NOT EXISTS — idempotent, safe to run
on existing installations. Fixes "eBay-Platform nicht konfiguriert" error
when opening the eBay category config CRUD.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simon Kuehn 2026-05-19 15:47:19 +00:00
parent 40834a8bd6
commit f1d3ee6b1e

View file

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260520110000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Seed eBay platform row if not present';
}
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
INSERT INTO app.platforms (id, type, label, config)
SELECT gen_random_uuid(), 'ebay', 'eBay', '[]'
WHERE NOT EXISTS (SELECT 1 FROM app.platforms WHERE type = 'ebay')
SQL);
}
public function down(Schema $schema): void
{
$this->addSql("DELETE FROM app.platforms WHERE type = 'ebay'");
}
}