<?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 Version20251010192254 extends AbstractMigration
{
public function getDescription(): string
{
return 'Change fees field to FLOAT to store numeric values with automatic formatting (decimals < 10 = %, integers < 10 = MAD, >= 10 = MAD)';
}
public function up(Schema $schema): void
{
// Change fees column from VARCHAR(255) to FLOAT using explicit cast
$this->addSql('ALTER TABLE property_visit_voucher ALTER COLUMN fees TYPE DOUBLE PRECISION USING fees::double precision');
}
public function down(Schema $schema): void
{
// Revert fees column back to VARCHAR(255)
$this->addSql('ALTER TABLE property_visit_voucher ALTER COLUMN fees TYPE VARCHAR(255)');
}
}