migrations/Version20230107153713.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20230107153713 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'extended log and company table';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $alter = <<<SQL
  18.         ALTER TABLE `company`  ADD COLUMN `words_max` INT DEFAULT 500;
  19.         ALTER TABLE `company`  ADD COLUMN `words_used` INT DEFAULT 0;
  20.         ALTER TABLE `company`  ADD COLUMN `day_of_reset` INT DEFAULT 1;
  21.         ALTER TABLE `company`  ADD COLUMN `maintenance` INT DEFAULT 0;
  22.         ALTER TABLE `company`  RENAME COLUMN `openai_api_key` TO `external_api_key`;
  23.         ALTER TABLE `log`      ADD COLUMN `created` DATE DEFAULT NULL;
  24.         ALTER TABLE `template` ADD COLUMN `type` enum('COMPLETE', 'EDIT') DEFAULT 'COMPLETE';
  25. SQL;
  26.         $this->addSql($alter);
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.     }
  32. }