<?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 Version20251023150318 extends AbstractMigration
{
public function getDescription(): string
{
return "On insère le produit pour gérer la souscription Link sur Copecart";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('INSERT INTO app_product (type, name, is_enabled, sku, marketing_name, space_id, is_subscibable, is_ikigai_pack, is_printable)
VALUES ("'.Product::PRODUCT_TYPE_LINK.'", "'.Product::LINK_SUBSCRIPTION.'", 1, "'.Product::LINK_SUBSCRIPTION.'", "Link", 1, 1, 0, 0)');
$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, 1000, 1000, 0, 0, "b96c7765", "b96c7765"),
(@product_id, 4, 2, 1, 1000, 1000, 0, 0, "b96c7765", "b96c7765"),
(@product_id, 4, 3, 1, 1000, 1000, 0, 0, "b96c7765", "b96c7765")
');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}