migrations/Version20251023150318.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 Version20251023150318 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return "On insère le produit pour gérer la souscription Link sur Copecart";
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         $this->addSql('INSERT INTO app_product (type, name, is_enabled, sku, marketing_name, space_id, is_subscibable, is_ikigai_pack, is_printable) 
  20.         VALUES ("'.Product::PRODUCT_TYPE_LINK.'", "'.Product::LINK_SUBSCRIPTION.'", 1, "'.Product::LINK_SUBSCRIPTION.'", "Link", 1, 1, 0, 0)');
  21.         $this->addSql("SET @product_id = LAST_INSERT_ID();");
  22.         $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) 
  23.         VALUES 
  24.             (@product_id, 4, 1, 1, 1000, 1000, 0, 0, "b96c7765", "b96c7765"),
  25.             (@product_id, 4, 2, 1, 1000, 1000, 0, 0, "b96c7765", "b96c7765"),
  26.             (@product_id, 4, 3, 1, 1000, 1000, 0, 0, "b96c7765", "b96c7765")
  27.         ');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.     }
  33. }