<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Entity\ProductDecreasing;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251207093522 extends AbstractMigration
{
public function getDescription(): string
{
return "On insère le produit premium dégressif en europe";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
// On insère la configuration du pack premium sur le marché europe
$this->addSql(
'INSERT INTO app_product_decreasing
(product_id, market_id, point_config, price_config, commission_config, is_enabled, copecart_product_id)
VALUES
(:product_id, :market_id, :point_config, :price_config, :commission_config, :is_enabled, :copecart_product_id)',
[
'product_id' => 9,
'market_id' => 1,
'point_config' => json_encode(ProductDecreasing::DEFAULT_POINT_CONFIG, JSON_THROW_ON_ERROR),
'price_config' => json_encode(ProductDecreasing::DEFAULT_PRICE_CONFIG, JSON_THROW_ON_ERROR),
'commission_config' => json_encode(ProductDecreasing::DEFAULT_COMMISSION_CONFIG, JSON_THROW_ON_ERROR),
'is_enabled' => true,
"copecart_product_id" => "d1577a87"
]
);
// Le pack dégressif remplace le pack premium 1 mois
$this->addSql('UPDATE app_product_price SET is_enabled = 0 WHERE product_id = 9 and market_id = 1 and nb_month = 1');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}