<?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 Version20251217073437 extends AbstractMigration
{
public function getDescription(): string
{
return "Création du produit GlassGlow";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
// 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_GLASS_GLOW_KEY."', 0, '".Product::PRODUCT_GLASS_GLOW_KEY."', 'GlassGlow', 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, 12),
(@product_id, 4, 2, 1, 0, 0, 0, 12),
(@product_id, 4, 3, 1, 0, 0, 0, 12)
;");
$this->addSql("INSERT INTO `app_product_point`
(`product_id`, `market_id`, `nb_month`, `first_points`, `subscription_points`)
VALUES
(@product_id, 1, 1, 35, 35),
(@product_id, 2, 1, 35, 35),
(@product_id, 3, 1, 35, 35)
;");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}