<?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 Version20250623014242 extends AbstractMigration
{
public function getDescription(): string
{
return "Création des produits pour Futures Learn (Ecom, Digital)";
}
public function up(Schema $schema): void
{
// Flexia
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_FLEXIA_KEY."', 0, '".Product::PRODUCT_FLEXIA_KEY."', 'Flexia', 2, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 5),
(@product_id, 4, 2, 1, 0, 0, 0, 5),
(@product_id, 4, 3, 1, 0, 0, 0, 5)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 19, 19),
(@product_id, 2, 1, 19, 19),
(@product_id, 3, 1, 19, 19)
;");
// Silicia
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_SILICIA_KEY."', 0, '".Product::PRODUCT_SILICIA_KEY."', 'Silicia', 2, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 5),
(@product_id, 4, 2, 1, 0, 0, 0, 5),
(@product_id, 4, 3, 1, 0, 0, 0, 5)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 19, 19),
(@product_id, 2, 1, 19, 19),
(@product_id, 3, 1, 19, 19)
;");
// Pulsia
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_PULSIA_KEY."', 0, '".Product::PRODUCT_PULSIA_KEY."', 'Pulsia', 2, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 5),
(@product_id, 4, 2, 1, 0, 0, 0, 5),
(@product_id, 4, 3, 1, 0, 0, 0, 5)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 19, 19),
(@product_id, 2, 1, 19, 19),
(@product_id, 3, 1, 19, 19)
;");
// DermaGlow
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_DERMA_GLOW_KEY."', 0, '".Product::PRODUCT_DERMA_GLOW_KEY."', 'DermaGlow', 2, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 9),
(@product_id, 4, 2, 1, 0, 0, 0, 9),
(@product_id, 4, 3, 1, 0, 0, 0, 9)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 26, 26),
(@product_id, 2, 1, 26, 26),
(@product_id, 3, 1, 26, 26)
;");
// Vitaliuum
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PRODUCT."', '".Product::PRODUCT_VITALIUUM_KEY."', 0, '".Product::PRODUCT_VITALIUUM_KEY."', 'Vitaliuum', 2, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 9),
(@product_id, 4, 2, 1, 0, 0, 0, 9),
(@product_id, 4, 3, 1, 0, 0, 0, 9)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 26, 26),
(@product_id, 2, 1, 26, 26),
(@product_id, 3, 1, 26, 26)
;");
// Pack CollagenCare
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `color`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PACK."', '".Product::PACK_COLLAGENCARE."', 0, '".Product::PACK_COLLAGENCARE."', 'CollagenCare', 2, '#68BC44', 1, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 16),
(@product_id, 4, 2, 1, 0, 0, 0, 16),
(@product_id, 4, 3, 1, 0, 0, 0, 16)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 45, 45),
(@product_id, 2, 1, 45, 45),
(@product_id, 3, 1, 45, 45)
;");
// Pack CollagenBeauty
$this->addSql("INSERT INTO `app_product`
(`type`, `name`, `is_enabled`, `sku`, `marketing_name`, `space_id`, `color`, `is_subscibable`, `is_ikigai_pack`, `is_printable`, `context`)
VALUES
('".Product::PRODUCT_TYPE_PACK."', '".Product::PACK_COLLAGENBEAUTY."', 0, '".Product::PACK_COLLAGENBEAUTY."', 'CollagenBeauty', 2, '#68BC44', 1, 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`)
VALUES
(@product_id, 4, 1, 1, 0, 0, 0, 16),
(@product_id, 4, 2, 1, 0, 0, 0, 16),
(@product_id, 4, 3, 1, 0, 0, 0, 16)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 45, 45),
(@product_id, 2, 1, 45, 45),
(@product_id, 3, 1, 45, 45)
;");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}