SuperSeller3000/migrations/Version20260520040000.php

58 lines
2 KiB
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260520040000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update vision_analyze prompt: split MODEL into MODEL_NAME/MODEL_NUMBER';
}
public function up(Schema $schema): void
{
$body = <<<'PROMPT'
Look at this nameplate/label photo of IT hardware.
Extract the manufacturer, any model identifier (name or number), and serial number visible on the label.
If the label shows both a product name (e.g. "ThinkPad T490s") and a separate part/product code (e.g. "20NXS0BA00"), put the product name in MODEL_NAME and the code in MODEL_NUMBER.
If only one model field is visible, put it in MODEL_NAME and leave MODEL_NUMBER completely empty.
MODEL_NUMBER must never contain the serial number.
Do not guess or add information not visible on the label.
Respond in exactly this format:
MANUFACTURER:
MODEL_NAME:
MODEL_NUMBER:
SERIAL:
Use empty string (nothing after the colon) when a field is not visible.
PROMPT;
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
'body' => $body,
'key' => 'vision_analyze',
]);
}
public function down(Schema $schema): void
{
$body = <<<'PROMPT'
Look at this nameplate/label photo of IT hardware.
Extract the manufacturer (brand), model number/designation, and serial number visible on the label.
Do not guess or add information not on the label.
Respond in exactly this format (use empty string if not visible):
MANUFACTURER: <brand name, e.g. Dell, HP, Lenovo, Medion>
MODEL: <model number or designation>
SERIAL: <serial number>
PROMPT;
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
'body' => $body,
'key' => 'vision_analyze',
]);
}
}