SuperSeller3000/migrations/Version20260520070000.php

66 lines
2.6 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260520070000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update eBay prompts: --- delimiters, commercial language, 1-year warranty';
}
public function up(Schema $schema): void
{
$title = <<<'PROMPT'
Create a concise eBay listing title (max 80 characters) for this {{typeName}}.
Device: {{deviceLabel}}
Condition: {{condition}} (used/gebraucht)
{{specsSection}}
Rules: no quotes, no explanation, no private-sale language.
Wrap your answer between --- delimiters like this:
---
your title here
---
PROMPT;
$description = <<<'PROMPT'
Erstelle eine professionelle eBay-Artikelbeschreibung auf Deutsch für diesen {{typeName}}.
Gerät: {{deviceLabel}}
Zustand: gebraucht {{condition}}
{{conditionNotes}}
{{specsSection}}
Wichtige Vorgaben:
- Gewerbliches Angebot (kein Privatverkauf, keine Privatverkauf-Ausschlussklauseln)
- 1 Jahr gesetzliche Gewährleistung
- Zustand "gebraucht" klar erwähnen
- Alle verfügbaren technischen Daten strukturiert auflisten
- HTML-Formatierung verwenden (ul, li, strong-Tags)
- Maximal 2000 Zeichen
Gib NUR den HTML-Beschreibungstext aus, eingefasst zwischen --- Trennzeichen:
---
HTML hier
---
PROMPT;
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
'body' => $title, 'key' => 'ebay_title',
]);
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
'body' => $description, 'key' => 'ebay_description',
]);
}
public function down(Schema $schema): void
{
$this->addSql("UPDATE app.prompt_templates SET body = 'Create a concise eBay listing title (max 80 characters) for this {{typeName}}.\nDevice: {{deviceLabel}}\nUse the most important specifications. Include condition if not \"new\".\nCondition: {{condition}}\n{{specsSection}}\nReturn ONLY the title text, no quotes, no explanation.', updated_at = NOW() WHERE key = 'ebay_title'");
$this->addSql("UPDATE app.prompt_templates SET body = 'Create a professional eBay listing description in German for this {{typeName}}.\nDevice: {{deviceLabel}}\nInclude all available specifications in a clear, structured format.\nMention the condition: {{condition}}.\n{{conditionNotes}}\n{{specsSection}}\nUse HTML formatting (ul, li, strong tags). Max 2000 characters.', updated_at = NOW() WHERE key = 'ebay_description'");
}
}