migrations/Version20221013192721.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. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20221013192721 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE notification_list (id INT AUTO_INCREMENT NOT NULL, company_id INT NOT NULL, notification_area_id INT NOT NULL, object_slug VARCHAR(255) NOT NULL, readed_at DATETIME DEFAULT NULL, status_type VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_FCF4B322979B1AD6 (company_id), INDEX IDX_FCF4B322A811CA2B (notification_area_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
  20.         $this->addSql('CREATE TABLE notification_area (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, visable_name VARCHAR(255) NOT NULL, module_name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322A811CA2B FOREIGN KEY (notification_area_id) REFERENCES notification_area (id)');
  22.         $this->addSql('ALTER TABLE addresses ADD slug LONGTEXT DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE addresses_mail ADD slug LONGTEXT DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE checks ADD slug LONGTEXT DEFAULT NULL');
  25.         // $this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322A811CA2B FOREIGN KEY (notification_area_id) REFERENCES notification_area (id)');
  26.         $this->addSql('ALTER TABLE notifications_service ADD slug LONGTEXT DEFAULT NULL, CHANGE company_id company_id INT DEFAULT NULL');
  27.         $this->addSql('ALTER TABLE project_comments ADD slug LONGTEXT DEFAULT NULL');
  28.         $this->addSql('ALTER TABLE translations ADD slug LONGTEXT DEFAULT NULL');
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.         $this->addSql('ALTER TABLE notification_list DROP FOREIGN KEY FK_FCF4B322A811CA2B');
  34.         $this->addSql('DROP TABLE notification_area');
  35.         $this->addSql('ALTER TABLE addresses DROP slug');
  36.         $this->addSql('ALTER TABLE addresses_mail DROP slug');
  37.         $this->addSql('ALTER TABLE checks DROP slug');
  38.         $this->addSql('ALTER TABLE notifications_service DROP slug, CHANGE company_id company_id INT NOT NULL');
  39.         $this->addSql('ALTER TABLE project_comments DROP slug');
  40.         $this->addSql('ALTER TABLE translations DROP slug');
  41.     }
  42. }