migrations/Version20211129151117.php line 1

Open in your IDE?
  1. <?php
    
    declare(strict_types=1);
    
    namespace DoctrineMigrations;
    
    use Doctrine\DBAL\Schema\Schema;
    use Doctrine\Migrations\AbstractMigration;
    
    /**
     * Auto-generated Migration: Please modify to your needs!
     */
    final class Version20211129151117 extends AbstractMigration
    {
        public function getDescription(): string
        {
            return '';
        }
    
        public function up(Schema $schema): void
        {
            // this up() migration is auto-generated, please modify it to your needs
            $this->addSql('DROP TABLE file_author');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('CREATE TABLE file_author (file_id INT NOT NULL, author_id INT NOT NULL, INDEX IDX_5B8FE7793CB796C (file_id), INDEX IDX_5B8FE77F675F31B (author_id), PRIMARY KEY(file_id, author_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
            $this->addSql('ALTER TABLE file_author ADD CONSTRAINT FK_5B8FE7793CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE CASCADE');
            $this->addSql('ALTER TABLE file_author ADD CONSTRAINT FK_5B8FE77F675F31B FOREIGN KEY (author_id) REFERENCES author (id) ON DELETE CASCADE');
        }
    }