migrations/Version20220601131123.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. /**
  6.  * Auto-generated Migration: Please modify to your needs!
  7.  */
  8. final class Version20220601131123 extends AbstractMigration
  9. {
  10.     public function getDescription(): string
  11.     {
  12.         return '';
  13.     }
  14.     public function up(Schema $schema): void
  15.     {
  16.         // this up() migration is auto-generated, please modify it to your needs
  17.         $this->addSql('ALTER TABLE user ADD created_by_id INT DEFAULT NULL');
  18.         $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  19.         $this->addSql('CREATE INDEX IDX_8D93D649B03A8386 ON user (created_by_id)');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         // this down() migration is auto-generated, please modify it to your needs
  24.         $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649B03A8386');
  25.         $this->addSql('DROP INDEX IDX_8D93D649B03A8386 ON user');
  26.         $this->addSql('ALTER TABLE user DROP created_by_id');
  27.     }
  28. }