<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250219085829 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE custom_instructions_chat (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE custom_instructions_message (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, chat_id BIGINT UNSIGNED DEFAULT NULL, text VARCHAR(255) NOT NULL, role VARCHAR(5) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_2D3D6FB91A9A7125 (chat_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE custom_instructions_message ADD CONSTRAINT FK_2D3D6FB91A9A7125 FOREIGN KEY (chat_id) REFERENCES custom_instructions_chat (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE custom_instructions_message DROP FOREIGN KEY FK_2D3D6FB91A9A7125');
$this->addSql('DROP TABLE custom_instructions_chat');
$this->addSql('DROP TABLE custom_instructions_message');
}
}