<?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 Version20240411214604 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 log_operation (id INT AUTO_INCREMENT NOT NULL, establishment_id INT NOT NULL, ip_address VARCHAR(128) NOT NULL, user_name VARCHAR(128) NOT NULL, type VARCHAR(128) NOT NULL, entity_name VARCHAR(128) NOT NULL, entity_id INT NOT NULL, message LONGTEXT NOT NULL, create_date DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_by INT NOT NULL, day VARCHAR(10) NOT NULL, month VARCHAR(10) NOT NULL, year VARCHAR(10) NOT NULL, INDEX IDX_F833AE38565851 (establishment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE log_operation ADD CONSTRAINT FK_F833AE38565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE log_operation');
}
}