<?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 Version20230911052407 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('CREATE TABLE fuel_index_list (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE fuel_index ADD fuel_index_list_id INT DEFAULT NULL, ADD value DOUBLE PRECISION NOT NULL, DROP index_cnr_gazole_pro, DROP index_cnr_gazole_excluding_tva, DROP index_cnr_fuel, DROP price_cnr_gazole_cuve_average_monthly, DROP price_cnr_gazole_cuve_end_of_month, DROP price_gazole_monthly_average_pump, DROP price_gazole_pump_end_of_month');
$this->addSql('ALTER TABLE fuel_index ADD CONSTRAINT FK_EAD338ABD38356E6 FOREIGN KEY (fuel_index_list_id) REFERENCES fuel_index_list (id)');
$this->addSql('CREATE INDEX IDX_EAD338ABD38356E6 ON fuel_index (fuel_index_list_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE fuel_index DROP FOREIGN KEY FK_EAD338ABD38356E6');
$this->addSql('DROP TABLE fuel_index_list');
$this->addSql('DROP INDEX IDX_EAD338ABD38356E6 ON fuel_index');
$this->addSql('ALTER TABLE fuel_index ADD index_cnr_gazole_excluding_tva DOUBLE PRECISION NOT NULL, ADD index_cnr_fuel DOUBLE PRECISION DEFAULT NULL, ADD price_cnr_gazole_cuve_average_monthly DOUBLE PRECISION NOT NULL, ADD price_cnr_gazole_cuve_end_of_month DOUBLE PRECISION NOT NULL, ADD price_gazole_monthly_average_pump DOUBLE PRECISION NOT NULL, ADD price_gazole_pump_end_of_month DOUBLE PRECISION NOT NULL, DROP fuel_index_list_id, CHANGE value index_cnr_gazole_pro DOUBLE PRECISION NOT NULL');
}
}