migrations/Version20250623014242.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 Version20250623014242 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return "Création des produits pour Futures Learn (Ecom, Digital)";
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // Flexia
  19.         $this->addSql("INSERT INTO `app_product` 
  20.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  21.             VALUES 
  22.             ('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_FLEXIA_KEY."', 0, '".Product::PRODUCT_FLEXIA_KEY."', 'Flexia', 2, 0, 0, 0, NULL);
  23.         ");
  24.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  25.         $this->addSql("INSERT INTO `app_product_price` 
  26.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  27.             VALUES 
  28.             (@product_id, 4, 1, 1, 0, 0, 0, 5),
  29.             (@product_id, 4, 2, 1, 0, 0, 0, 5),
  30.             (@product_id, 4, 3, 1, 0, 0, 0, 5)
  31.         ;");
  32.         $this->addSql("INSERT INTO `app_product_point` 
  33.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  34.             VALUES 
  35.             (@product_id, 1, 1, 19, 19),
  36.             (@product_id, 2, 1, 19, 19),
  37.             (@product_id, 3, 1, 19, 19)
  38.         ;");
  39.         // Silicia
  40.         $this->addSql("INSERT INTO `app_product` 
  41.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  42.             VALUES 
  43.             ('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_SILICIA_KEY."', 0, '".Product::PRODUCT_SILICIA_KEY."', 'Silicia', 2, 0, 0, 0, NULL);
  44.         ");
  45.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  46.         $this->addSql("INSERT INTO `app_product_price` 
  47.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  48.             VALUES 
  49.             (@product_id, 4, 1, 1, 0, 0, 0, 5),
  50.             (@product_id, 4, 2, 1, 0, 0, 0, 5),
  51.             (@product_id, 4, 3, 1, 0, 0, 0, 5)
  52.         ;");
  53.         $this->addSql("INSERT INTO `app_product_point` 
  54.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  55.             VALUES 
  56.             (@product_id, 1, 1, 19, 19),
  57.             (@product_id, 2, 1, 19, 19),
  58.             (@product_id, 3, 1, 19, 19)
  59.         ;");
  60.         // Pulsia
  61.         $this->addSql("INSERT INTO `app_product` 
  62.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  63.             VALUES 
  64.             ('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_PULSIA_KEY."', 0, '".Product::PRODUCT_PULSIA_KEY."', 'Pulsia', 2, 0, 0, 0, NULL);
  65.         ");
  66.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  67.         $this->addSql("INSERT INTO `app_product_price` 
  68.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  69.             VALUES 
  70.             (@product_id, 4, 1, 1, 0, 0, 0, 5),
  71.             (@product_id, 4, 2, 1, 0, 0, 0, 5),
  72.             (@product_id, 4, 3, 1, 0, 0, 0, 5)
  73.         ;");
  74.         $this->addSql("INSERT INTO `app_product_point` 
  75.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  76.             VALUES 
  77.             (@product_id, 1, 1, 19, 19),
  78.             (@product_id, 2, 1, 19, 19),
  79.             (@product_id, 3, 1, 19, 19)
  80.         ;");
  81.         // DermaGlow
  82.         $this->addSql("INSERT INTO `app_product` 
  83.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  84.             VALUES 
  85.             ('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_DERMA_GLOW_KEY."', 0, '".Product::PRODUCT_DERMA_GLOW_KEY."', 'DermaGlow', 2, 0, 0, 0, NULL);
  86.         ");
  87.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  88.         $this->addSql("INSERT INTO `app_product_price` 
  89.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  90.             VALUES 
  91.             (@product_id, 4, 1, 1, 0, 0, 0, 9),
  92.             (@product_id, 4, 2, 1, 0, 0, 0, 9),
  93.             (@product_id, 4, 3, 1, 0, 0, 0, 9)
  94.         ;");
  95.         $this->addSql("INSERT INTO `app_product_point` 
  96.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  97.             VALUES 
  98.             (@product_id, 1, 1, 26, 26),
  99.             (@product_id, 2, 1, 26, 26),
  100.             (@product_id, 3, 1, 26, 26)
  101.         ;");
  102.         // Vitaliuum
  103.         $this->addSql("INSERT INTO `app_product` 
  104.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  105.             VALUES 
  106.             ('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_VITALIUUM_KEY."', 0, '".Product::PRODUCT_VITALIUUM_KEY."', 'Vitaliuum', 2, 0, 0, 0, NULL);
  107.         ");
  108.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  109.         $this->addSql("INSERT INTO `app_product_price` 
  110.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  111.             VALUES 
  112.             (@product_id, 4, 1, 1, 0, 0, 0, 9),
  113.             (@product_id, 4, 2, 1, 0, 0, 0, 9),
  114.             (@product_id, 4, 3, 1, 0, 0, 0, 9)
  115.         ;");
  116.         $this->addSql("INSERT INTO `app_product_point` 
  117.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  118.             VALUES 
  119.             (@product_id, 1, 1, 26, 26),
  120.             (@product_id, 2, 1, 26, 26),
  121.             (@product_id, 3, 1, 26, 26)
  122.         ;");
  123.         // Pack CollagenCare
  124.         $this->addSql("INSERT INTO `app_product` 
  125.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `color`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  126.             VALUES 
  127.             ('".Product::PRODUCT_TYPE_PACK."', '".Product::PACK_COLLAGENCARE."', 0, '".Product::PACK_COLLAGENCARE."', 'CollagenCare', 2, '#68BC44', 1, 0, 0, NULL);
  128.         ");
  129.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  130.         $this->addSql("INSERT INTO `app_product_price` 
  131.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  132.             VALUES 
  133.             (@product_id, 4, 1, 1, 0, 0, 0, 16),
  134.             (@product_id, 4, 2, 1, 0, 0, 0, 16),
  135.             (@product_id, 4, 3, 1, 0, 0, 0, 16)
  136.         ;");
  137.         $this->addSql("INSERT INTO `app_product_point` 
  138.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  139.             VALUES 
  140.             (@product_id, 1, 1, 45, 45),
  141.             (@product_id, 2, 1, 45, 45),
  142.             (@product_id, 3, 1, 45, 45)
  143.         ;");
  144.         // Pack CollagenBeauty
  145.         $this->addSql("INSERT INTO `app_product` 
  146.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `color`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  147.             VALUES 
  148.             ('".Product::PRODUCT_TYPE_PACK."', '".Product::PACK_COLLAGENBEAUTY."', 0, '".Product::PACK_COLLAGENBEAUTY."', 'CollagenBeauty', 2, '#68BC44', 1, 0, 0, NULL);
  149.         ");
  150.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  151.         $this->addSql("INSERT INTO `app_product_price` 
  152.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`) 
  153.             VALUES 
  154.             (@product_id, 4, 1, 1, 0, 0, 0, 16),
  155.             (@product_id, 4, 2, 1, 0, 0, 0, 16),
  156.             (@product_id, 4, 3, 1, 0, 0, 0, 16)
  157.         ;");
  158.         $this->addSql("INSERT INTO `app_product_point` 
  159.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  160.             VALUES 
  161.             (@product_id, 1, 1, 45, 45),
  162.             (@product_id, 2, 1, 45, 45),
  163.             (@product_id, 3, 1, 45, 45)
  164.         ;");
  165.     }
  166.     public function down(Schema $schema): void
  167.     {
  168.         // this down() migration is auto-generated, please modify it to your needs
  169.     }
  170. }