<?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 Version20221013192721 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('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');
$this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$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');
$this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322A811CA2B FOREIGN KEY (notification_area_id) REFERENCES notification_area (id)');
$this->addSql('ALTER TABLE addresses ADD slug LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE addresses_mail ADD slug LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE checks ADD slug LONGTEXT DEFAULT NULL');
// $this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322A811CA2B FOREIGN KEY (notification_area_id) REFERENCES notification_area (id)');
$this->addSql('ALTER TABLE notifications_service ADD slug LONGTEXT DEFAULT NULL, CHANGE company_id company_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE project_comments ADD slug LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE translations ADD slug LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE notification_list DROP FOREIGN KEY FK_FCF4B322A811CA2B');
$this->addSql('DROP TABLE notification_area');
$this->addSql('ALTER TABLE addresses DROP slug');
$this->addSql('ALTER TABLE addresses_mail DROP slug');
$this->addSql('ALTER TABLE checks DROP slug');
$this->addSql('ALTER TABLE notifications_service DROP slug, CHANGE company_id company_id INT NOT NULL');
$this->addSql('ALTER TABLE project_comments DROP slug');
$this->addSql('ALTER TABLE translations DROP slug');
}
}