<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Symfony\Component\Uid\Uuid;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250610103051 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add guid VARCHAR(36) to app_academy and populate existing data based on title/language.';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE app_academy ADD guid VARCHAR(36) NULL');
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Trades University' AND `language` = 'ar'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Immo University' AND `language` = 'ar'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Crypto University' AND `language` = 'ar'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Bourse University' AND `language` = 'ar'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Trades University' AND `language` = 'en'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Immo University' AND `language` = 'en'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Crypto University' AND `language` = 'en'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Bourse University' AND `language` = 'en'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Trades University' AND `language` = 'es'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Immo University' AND `language` = 'es'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Crypto University' AND `language` = 'es'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Bourse University' AND `language` = 'es'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Trades University' AND `language` = 'fr'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Immo University' AND `language` = 'fr'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Crypto University' AND `language` = 'fr'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Bourse University' AND `language` = 'fr'");
$this->addSql("UPDATE `app_academy` SET `guid` = '". Uuid::v6()->jsonSerialize() ."' WHERE `title` = 'Tes premiers pas avec Mybiz' AND `language` = 'fr'");
$this->addSql('CREATE UNIQUE INDEX UNIQ_74108E862B6FCFB2 ON app_academy (guid)');
$this->addSql('ALTER TABLE app_media_content ADD duration INT DEFAULT NULL');
$this->addSql('ALTER TABLE app_media_content ADD thumbnail VARCHAR(255) DEFAULT NULL');
// Ecom Academy
$this->addSql("INSERT INTO `app_feature_type` (`name`, `color`, `is_enabled`, `marketing_name`, `space_id`) VALUES ('ecom', '#25893F', 1, 'Ecom', (SELECT `id` from `app_space` WHERE `name` = 'futures_infinity'));");
$this->addSql("SET @feature_type_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_feature` (`feature_type_id`, `name`, `is_enabled`, `image`, `is_bundle`, `type`, `translation_key`) VALUES (@feature_type_id, 'Ecom University', 1, NULL, 0, 'university', '');");
$this->addSql("SET @feature_id = LAST_INSERT_ID();");
// FR
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Ecom Academy', '', 1, 'fr', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'MODULE 1', 'Les clés pour réussir durablement', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'Premiers pas avec Ecom Académie', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - Bienvenue dans l\'académie Ecom !', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// EN
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Ecom Academy', '', 1, 'en', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'MODULE 1', 'Keys to sustainable success', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'First steps with Ecom Academy', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - Welcome to the Ecom Academy!', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// ES
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Ecom Academy', '', 1, 'es', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'MÓDULO 1', 'Claves para el éxito sostenible', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'Primeros pasos con Ecom Academy', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - ¡Bienvenido a la Ecom Academy!', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// AR
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Ecom Academy', '', 1, 'ar', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'الوحدة 1', 'مفاتيح النجاح المستدام', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'الخطوات الأولى مع Ecom Academy', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - مرحبًا بك في Ecom Academy!', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// Digital Academy
$this->addSql("INSERT INTO `app_feature_type` (`name`, `color`, `is_enabled`, `marketing_name`, `space_id`) VALUES ('digital', '#F60C3B', 1, 'Digital', (SELECT `id` from `app_space` WHERE `name` = 'futures_infinity'));");
$this->addSql("SET @feature_type_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_feature` (`feature_type_id`, `name`, `is_enabled`, `image`, `is_bundle`, `type`, `translation_key`) VALUES (@feature_type_id, 'Digital University', 1, NULL, 0, 'university', '');");
$this->addSql("SET @feature_id = LAST_INSERT_ID();");
// FR
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Digital Academy', '', 1, 'fr', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'MODULE 1', 'Les clés pour réussir durablement', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'Premiers pas avec Digital Académie', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - Bienvenue dans l\'académie Digital !', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// EN
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Digital Academy', '', 1, 'en', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'MODULE 1', 'Keys to sustainable success', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'First steps with Digital Academy', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - Welcome to the Digital Academy!', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// ES
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Digital Academy', '', 1, 'es', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'MÓDULO 1', 'Claves para el éxito sostenible', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'Primeros pasos con Digital Academy', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - ¡Bienvenido a la Digital Academy!', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
// AR
$academyGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_academy` (`feature_id`, `title`, `description`, `is_enabled`, `language`, `educator_id`, `guid`) VALUES (@feature_id, 'Digital Academy', '', 1, 'ar', (SELECT `id` from `app_user` WHERE `email` = 'mathieu.roccia@futures-infinity.com'), '" . $academyGuid . "')");
$this->addSql("SET @academy_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_chapter` (`academy_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@academy_id, NULL, '', 1, 1)");
$this->addSql("SET @chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_sub_chapter` (`academy_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@chapter_id, 'الوحدة 1', 'مفاتيح النجاح المستدام', 1, 1)");
$this->addSql("SET @sub_chapter_id = LAST_INSERT_ID();");
$this->addSql("INSERT INTO `app_academy_category` (`academy_sub_chapter_id`, `title`, `description`, `position`, `is_enabled`) VALUES (@sub_chapter_id, 'الخطوات الأولى مع Digital Academy', '', 5, 1)");
$this->addSql("SET @category_id = LAST_INSERT_ID();");
$mediaGuid = Uuid::v6()->jsonSerialize();
$this->addSql("INSERT INTO `app_media_content` (`academy_category_id`, `feature_tutorial_id`, `book_id`, `guid`, `position`, `title`, `description`, `is_enabled`, `is_required`, `url`, `type`, `link`, `text`, `duration`, `thumbnail`) VALUES (@category_id, NULL, NULL, '" . $mediaGuid . "', 5, '1.1 - مرحبًا بك في Digital Academy!', '', 1, 0, '', 'media_content_video', 'https://player.vimeo.com/video/1086212588', NULL, 194, 'https://i.vimeocdn.com/video/2017936484-da665916df4d2f97f31c47a84018224794f40e5b9fb53d23ab34c49ad3dddee2-d_640?region=us')");
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX UNIQ_74108E862B6FCFB2 ON app_academy');
$this->addSql('ALTER TABLE app_academy DROP guid');
$this->addSql('ALTER TABLE app_media_content DROP duration');
$this->addSql('ALTER TABLE app_media_content DROP thumbnail');
}
}