<?php

declare(strict_types=1);

namespace Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20251006214635 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Change IP column to INT UNSIGNED for IPv4 storage (4 bytes)';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE reloadsperre CHANGE ip ip INT UNSIGNED NOT NULL');
        $this->addSql('ALTER TABLE users CHANGE rolle rolle ENUM(\'user\', \'admin\', \'werbenetzwerk\')');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE reloadsperre CHANGE ip ip VARBINARY(16) NOT NULL');
        $this->addSql('ALTER TABLE users CHANGE rolle rolle ENUM(\'user\', \'admin\', \'werbenetzwerk\') DEFAULT NULL');
    }
}
