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>
30 lines
755 B
PHP
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'");
|
|
}
|
|
}
|