hesabix/core/migrations/Version20241201000001.php

32 lines
852 B
PHP
Raw Permalink Normal View History

2025-09-01 20:51:04 +03:30
<?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 Version20241201000001 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add lastLoginAt and loginCount fields to user table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE `user` ADD last_login_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE `user` ADD login_count INT NOT NULL DEFAULT 0');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE `user` DROP last_login_at');
$this->addSql('ALTER TABLE `user` DROP login_count');
}
}