migrations/Version20251207093522.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Entity\ProductDecreasing;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20251207093522 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return "On insère le produit premium dégressif en europe";
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         // On insère la configuration du pack premium sur le marché europe
  20.         $this->addSql(
  21.             'INSERT INTO app_product_decreasing
  22.         (product_id, market_id, point_config, price_config, commission_config, is_enabled, copecart_product_id)
  23.      VALUES
  24.         (:product_id, :market_id, :point_config, :price_config, :commission_config, :is_enabled, :copecart_product_id)',
  25.             [
  26.                 'product_id' => 9,
  27.                 'market_id' => 1,
  28.                 'point_config' => json_encode(ProductDecreasing::DEFAULT_POINT_CONFIGJSON_THROW_ON_ERROR),
  29.                 'price_config' => json_encode(ProductDecreasing::DEFAULT_PRICE_CONFIGJSON_THROW_ON_ERROR),
  30.                 'commission_config' => json_encode(ProductDecreasing::DEFAULT_COMMISSION_CONFIGJSON_THROW_ON_ERROR),
  31.                 'is_enabled' => true,
  32.                 "copecart_product_id" => "d1577a87"
  33.             ]
  34.         );
  35.         // Le pack dégressif remplace le pack premium 1 mois
  36.         $this->addSql('UPDATE app_product_price SET is_enabled = 0 WHERE product_id = 9 and market_id = 1 and nb_month = 1');
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.     }
  42. }