<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Utils\CommonFunctions;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Migración para insertar colores por defecto en la tabla color
*/
final class Version20251031140124 extends AbstractMigration
{
public function getDescription(): string
{
return 'Inserción de colores por defecto para Header, Aside y Secciones';
}
public function up(Schema $schema): void
{
// Insertar colores por defecto desde archivo SQL
$this->addSql(CommonFunctions::getFile(__DIR__ . '/Data/insert_colores_default.sql'));
}
public function down(Schema $schema): void
{
// Eliminar los colores insertados
$this->addSql("DELETE FROM color WHERE clase IN (
'bg-content-hero-cyan',
'bg-content-hero-sky',
'bg-content-hero-yellow',
'bg-content-hero-purple',
'bg-content-hero-blue',
'bg-content-hero-red',
'bg-aside-hero-dark',
'bg-aside-hero-light',
'bg-white',
'bg-light'
)");
}
}