SuperSeller3000/migrations/Version20260520110000.php

31 lines
755 B
PHP
Raw Normal View History

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