SuperSeller3000/migrations/Version20260520110000.php
Simon Kuehn f1d3ee6b1e
Some checks are pending
CI / test (push) Waiting to run
feat: seed eBay platform row via migration
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>
2026-05-19 15:47:19 +00:00

30 lines
755 B
PHP

<?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'");
}
}