migrations/Version20251217073437.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Entity\Product;
  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 Version20251217073437 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return "Création du produit GlassGlow";
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         // DermaGlow
  20.         $this->addSql("INSERT INTO `app_product`
  21.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
  22.             VALUES
  23.             ('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_GLASS_GLOW_KEY."', 0, '".Product::PRODUCT_GLASS_GLOW_KEY."', 'GlassGlow', 2, 0, 0, 0, NULL);
  24.         ");
  25.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  26.         $this->addSql("INSERT INTO `app_product_price`
  27.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`)
  28.             VALUES
  29.             (@product_id, 4, 1, 1, 0, 0, 0, 12),
  30.             (@product_id, 4, 2, 1, 0, 0, 0, 12),
  31.             (@product_id, 4, 3, 1, 0, 0, 0, 12)
  32.         ;");
  33.         $this->addSql("INSERT INTO `app_product_point`
  34.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
  35.             VALUES
  36.             (@product_id, 1, 1, 35, 35),
  37.             (@product_id, 2, 1, 35, 35),
  38.             (@product_id, 3, 1, 35, 35)
  39.         ;");
  40.     }
  41.     public function down(Schema $schema): void
  42.     {
  43.         // this down() migration is auto-generated, please modify it to your needs
  44.     }
  45. }