<?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 Version20230110184406 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 actions_logs (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, action_id INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_3A0ABFB619EB6921 (client_id), INDEX IDX_3A0ABFB69D32F035 (action_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE actions_logs ADD CONSTRAINT FK_3A0ABFB619EB6921 FOREIGN KEY (client_id) REFERENCES clients (id)');
$this->addSql('ALTER TABLE actions_logs ADD CONSTRAINT FK_3A0ABFB69D32F035 FOREIGN KEY (action_id) REFERENCES actions (id)');
$this->addSql('ALTER TABLE actions ADD message LONGTEXT DEFAULT NULL, ADD icon VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE actions_logs');
$this->addSql('ALTER TABLE actions DROP message, DROP icon');
}
}