38 lines
1.1 KiB
PHP
38 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');
|
||
|
|
}
|
||
|
|
}
|