<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230116094711 extends AbstractMigration
{
public function getDescription(): string
{
return 'table to store connexions log';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE SEQUENCE connexion_log_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE connexion_log (id INT NOT NULL, ip VARCHAR(255) DEFAULT NULL,
browser VARCHAR(255) DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL,
user_id INT NOT NULL, PRIMARY KEY(id))');
}
public function down(Schema $schema): void
{
$this->addSql('DROP SEQUENCE connexion_log_id_seq CASCADE');
$this->addSql('DROP TABLE connexion_log');
}
}