<?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 Version20260202183530 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('ALTER TABLE pedometer_log ADD log_date DATE NOT NULL, ADD updated_at DATETIME DEFAULT NULL, ADD source VARCHAR(50) DEFAULT NULL, ADD regularization_count INT DEFAULT 0 NOT NULL, ADD previous_step_amount INT DEFAULT NULL, CHANGE step_amount step_amount INT DEFAULT 0 NOT NULL');
$this->addSql('CREATE INDEX idx_log_date ON pedometer_log (log_date)');
$this->addSql('CREATE UNIQUE INDEX unique_user_day ON pedometer_log (user_id, log_date)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX idx_log_date ON pedometer_log');
$this->addSql('DROP INDEX unique_user_day ON pedometer_log');
$this->addSql('ALTER TABLE pedometer_log DROP log_date, DROP updated_at, DROP source, DROP regularization_count, DROP previous_step_amount, CHANGE step_amount step_amount INT DEFAULT NULL');
}
}