SuperSeller3000/migrations/Version20260519000000.php
Simon Kuehn 49e36a0a06 feat: editable AI prompt templates and articleType context in specs research
All agent prompts are now stored in app.prompt_templates (migration 20260519000000)
and editable by admins via the new AI Prompts CRUD page. If no DB entry exists
for a key the hardcoded default is used automatically as fallback.

PromptTemplateService renders templates with {{variable}} substitution.
All four agents (SpecsResearch, JsonCoding, EbayText, OllamaVision) use the service.

SpecsResearchAgent now receives the articleType name (e.g. "Laptop") so the
specs prompt is scoped to the correct device category instead of being generic.
SpecsResearchHandler loads the ArticleType from the repository for this purpose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 07:19:02 +00:00

37 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260519000000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create prompt_templates table for editable AI prompts';
}
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
CREATE TABLE app.prompt_templates (
id UUID NOT NULL,
key VARCHAR(100) NOT NULL,
body TEXT NOT NULL,
updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL,
PRIMARY KEY (id),
CONSTRAINT uq_prompt_template_key UNIQUE (key)
)
SQL);
$this->addSql("COMMENT ON COLUMN app.prompt_templates.id IS '(DC2Type:uuid)'");
$this->addSql("COMMENT ON COLUMN app.prompt_templates.updated_at IS '(DC2Type:datetime_immutable)'");
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE app.prompt_templates');
}
}