ogcore/migrations/Version20260413104014.php

45 lines
1.2 KiB
PHP

<?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 Version20260413104014 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('partition');
if (!$table->hasColumn('deploy_date')) {
$this->addSql('ALTER TABLE `partition` ADD deploy_date DATETIME DEFAULT NULL');
}
$cacheContent = $table->getColumn('cache_content');
if ($cacheContent->getType()->getName() !== 'text') {
$this->addSql('ALTER TABLE `partition` CHANGE cache_content cache_content LONGTEXT DEFAULT NULL');
}
}
public function down(Schema $schema): void
{
$table = $schema->getTable('partition');
if ($table->hasColumn('deploy_date')) {
$this->addSql('ALTER TABLE `partition` DROP deploy_date');
}
$this->addSql('ALTER TABLE `partition` CHANGE cache_content cache_content VARCHAR(255) DEFAULT NULL');
}
}