<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Entity\Product;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250613113957 extends AbstractMigration
{
public function getDescription(): string
{
return "Création des produits pour Futures Learn (Ecom, Digital)";
}
public function up(Schema $schema): void
{
// Digital
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_THEME_DIGITAL."', 1, '".Product::FORMATION_THEME_DIGITAL."', 'Learn Digital', '#FFA756', 1, 0, 0, 0, NULL);
");
$this->addSql("SET @product_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_product_price`
(`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`)
VALUES
(@product_id, 4, 1, 1, 41500, 41500, 0, 112, '368ac5c4', '368ac5c4'),
(@product_id, 4, 2, 1, 21000, 21000, 0, 58, 'bf7d9eab', 'bf7d9eab'),
(@product_id, 4, 3, 1, 21000, 21000, 0, 58, 'bf7d9eab', 'bf7d9eab')
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 220, 220),
(@product_id, 2, 1, 110, 110),
(@product_id, 3, 1, 110, 110)
;");
// Ecom
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_THEME_ECOM."', 0, '".Product::FORMATION_THEME_ECOM."', 'Learn Ecom', '#F10756', 1, 0, 0, 0, NULL);
");
$this->addSql("SET @product_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_product_price`
(`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`)
VALUES
(@product_id, 4, 1, 1, 65000, 65000, 0, 180, '18f8f45b', '18f8f45b'),
(@product_id, 4, 2, 1, 32500, 32500, 0, 90, 'a7554c3b', 'a7554c3b'),
(@product_id, 4, 3, 1, 32500, 32500, 0, 90, 'a7554c3b', 'a7554c3b')
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 340, 340),
(@product_id, 2, 1, 170, 170),
(@product_id, 3, 1, 170, 170)
;");
// Finance
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_THEME_FINANCE."', 0, '".Product::FORMATION_THEME_FINANCE."', 'Learn Finance', '#FFA756', 1, 0, 0, 0, NULL);
");
// Package Digital + Ecom
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `color`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_FORMATION."', '".Product::FORMATION_PACKAGE_DIGITAL_ECOM."', 1, '".Product::FORMATION_PACKAGE_DIGITAL_ECOM."', 'Learn Digital & Ecom', '#FFA756', 1, 0, 0, 0, NULL);
");
$this->addSql("SET @product_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_product_price`
(`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`)
VALUES
(@product_id, 4, 1, 1, 94700, 94700, 0, 219, '980dea86', '980dea86'),
(@product_id, 4, 2, 1, 47700, 47700, 0, 111, '686fb8a9', '686fb8a9'),
(@product_id, 4, 3, 1, 47700, 47700, 0, 111, '686fb8a9', '686fb8a9')
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 420, 420),
(@product_id, 2, 1, 210, 210),
(@product_id, 3, 1, 210, 210)
;");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}