migrations/Version20250219085829.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20250219085829 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return '';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $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');
  15.         $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');
  16.         $this->addSql('ALTER TABLE custom_instructions_message ADD CONSTRAINT FK_2D3D6FB91A9A7125 FOREIGN KEY (chat_id) REFERENCES custom_instructions_chat (id)');
  17.     }
  18.     public function down(Schema $schema): void
  19.     {
  20.         $this->addSql('ALTER TABLE custom_instructions_message DROP FOREIGN KEY FK_2D3D6FB91A9A7125');
  21.         $this->addSql('DROP TABLE custom_instructions_chat');
  22.         $this->addSql('DROP TABLE custom_instructions_message');
  23.     }
  24. }