<?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 Version20250603065416 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 SEQUENCE log_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE log (id INT NOT NULL, created_user_id UUID DEFAULT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, ip TEXT DEFAULT NULL, host TEXT DEFAULT NULL, description TEXT NOT NULL, alert TEXT DEFAULT NULL, action TEXT DEFAULT NULL, url TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_8F3F68C5E104C1D3 ON log (created_user_id)');
$this->addSql('COMMENT ON COLUMN log.created_user_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE log ADD CONSTRAINT FK_8F3F68C5E104C1D3 FOREIGN KEY (created_user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE log_id_seq CASCADE');
$this->addSql('ALTER TABLE log DROP CONSTRAINT FK_8F3F68C5E104C1D3');
$this->addSql('DROP TABLE log');
}
}