migrations/Version20250613113957.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 Version20250613113957 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.         // Digital
  19.         $this->addSql("INSERT INTO `app_product` 
  20.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  21.             VALUES 
  22.             ('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_THEME_DIGITAL."', 1, '".Product::FORMATION_THEME_DIGITAL."', 'Learn Digital', '#FFA756', 1, 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`, `copecart_product_id_with_first_price`, `copecart_product_id_only_subscription`) 
  27.             VALUES 
  28.             (@product_id, 4, 1, 1, 41500, 41500, 0, 112, '368ac5c4', '368ac5c4'),
  29.             (@product_id, 4, 2, 1, 21000, 21000, 0, 58, 'bf7d9eab', 'bf7d9eab'),
  30.             (@product_id, 4, 3, 1, 21000, 21000, 0, 58, 'bf7d9eab', 'bf7d9eab')
  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, 220, 220),
  36.             (@product_id, 2, 1, 110, 110),
  37.             (@product_id, 3, 1, 110, 110)
  38.         ;");
  39.         // Ecom
  40.         $this->addSql("INSERT INTO `app_product` 
  41.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  42.             VALUES 
  43.             ('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_THEME_ECOM."', 0, '".Product::FORMATION_THEME_ECOM."', 'Learn Ecom', '#F10756', 1, 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`, `copecart_product_id_with_first_price`, `copecart_product_id_only_subscription`) 
  48.             VALUES 
  49.             (@product_id, 4, 1, 1, 65000, 65000, 0, 180, '18f8f45b', '18f8f45b'),
  50.             (@product_id, 4, 2, 1, 32500, 32500, 0, 90, 'a7554c3b', 'a7554c3b'),
  51.             (@product_id, 4, 3, 1, 32500, 32500, 0, 90, 'a7554c3b', 'a7554c3b')
  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, 340, 340),
  57.             (@product_id, 2, 1, 170, 170),
  58.             (@product_id, 3, 1, 170, 170)
  59.         ;");
  60.         // Finance
  61.         $this->addSql("INSERT INTO `app_product` 
  62.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  63.             VALUES 
  64.             ('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_THEME_FINANCE."', 0, '".Product::FORMATION_THEME_FINANCE."', 'Learn Finance', '#FFA756', 1, 0, 0, 0, NULL);
  65.         ");
  66.         // Package Digital + Ecom
  67.         $this->addSql("INSERT INTO `app_product` 
  68.             (`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`) 
  69.             VALUES 
  70.             ('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_PACKAGE_DIGITAL_ECOM."', 1, '".Product::FORMATION_PACKAGE_DIGITAL_ECOM."', 'Learn Digital & Ecom', '#FFA756', 1, 0, 0, 0, NULL);
  71.         ");
  72.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  73.         $this->addSql("INSERT INTO `app_product_price` 
  74.             (`product_id`, `currency_id`, `market_id`, `nb_month`, `first_price`, `subscription_price`, `first_commission`, `subscription_commission`, `copecart_product_id_with_first_price`, `copecart_product_id_only_subscription`) 
  75.             VALUES 
  76.             (@product_id, 4, 1, 1, 94700, 94700, 0, 219, '980dea86', '980dea86'),
  77.             (@product_id, 4, 2, 1, 47700, 47700, 0, 111, '686fb8a9', '686fb8a9'),
  78.             (@product_id, 4, 3, 1, 47700, 47700, 0, 111, '686fb8a9', '686fb8a9')
  79.         ;");
  80.         $this->addSql("INSERT INTO `app_product_point` 
  81.             (`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`) 
  82.             VALUES 
  83.             (@product_id, 1, 1, 420, 420),
  84.             (@product_id, 2, 1, 210, 210),
  85.             (@product_id, 3, 1, 210, 210)
  86.         ;");
  87.     }
  88.     public function down(Schema $schema): void
  89.     {
  90.         // this down() migration is auto-generated, please modify it to your needs
  91.     }
  92. }