CREATE TABLE IF NOT EXISTS `__EFMigrationsHistory` (
    `MigrationId` varchar(150) CHARACTER SET utf8mb4 NOT NULL,
    `ProductVersion` varchar(32) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK___EFMigrationsHistory` PRIMARY KEY (`MigrationId`)
) CHARACTER SET=utf8mb4;

START TRANSACTION;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    ALTER DATABASE CHARACTER SET utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `Categories` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `ParentCategoryId` bigint NULL,
        `Name` longtext CHARACTER SET utf8mb4 NULL,
        `Description` longtext CHARACTER SET utf8mb4 NULL,
        CONSTRAINT `PK_Categories` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_Categories_Categories_ParentCategoryId` FOREIGN KEY (`ParentCategoryId`) REFERENCES `Categories` (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `ConfigurationProfiles` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Name` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Version` varchar(255) CHARACTER SET utf8mb4 NULL,
        `TargetSoftware` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Description` longtext CHARACTER SET utf8mb4 NULL,
        CONSTRAINT `PK_ConfigurationProfiles` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `Feeds` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `CodeName` longtext CHARACTER SET utf8mb4 NULL,
        `Name` longtext CHARACTER SET utf8mb4 NULL,
        `Description` longtext CHARACTER SET utf8mb4 NULL,
        `Vendor` longtext CHARACTER SET utf8mb4 NULL,
        `License` longtext CHARACTER SET utf8mb4 NULL,
        `LicenseUrl` longtext CHARACTER SET utf8mb4 NULL,
        `Url` varchar(2048) CHARACTER SET utf8mb4 NULL,
        `IgnoreTlsErrors` tinyint(1) NOT NULL,
        `Status` int NOT NULL,
        `Type` int NOT NULL,
        `FormatSettings` longtext CHARACTER SET utf8mb4 NULL,
        `IndicatorsScore` bigint NOT NULL,
        `Software` int NOT NULL,
        `UpdateFrequency` int NOT NULL,
        `AuthData` longtext CHARACTER SET utf8mb4 NULL,
        `StatusForNewRule` longtext CHARACTER SET utf8mb4 NULL,
        `StatusForNewRuleRev` longtext CHARACTER SET utf8mb4 NULL,
        `StatusForCurrentRuleRev` longtext CHARACTER SET utf8mb4 NULL,
        `ImportOldRuleRev` tinyint(1) NOT NULL,
        `ExpireIndicatorsAfter` bigint NOT NULL,
        `WhereToDeploy` int NOT NULL,
        `Clusters` longtext CHARACTER SET utf8mb4 NULL,
        `Order` bigint NOT NULL,
        `LastSuccessfulUpdate` datetime(6) NOT NULL,
        `LastSuccessfulCheck` datetime(6) NOT NULL,
        `LastDownloadedVersionHash` longtext CHARACTER SET utf8mb4 NULL,
        CONSTRAINT `PK_Feeds` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `Indicators` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Value` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Score` bigint NOT NULL,
        `Type` int NOT NULL,
        `Status` int NOT NULL,
        `Sources` longtext CHARACTER SET utf8mb4 NULL,
        `CreatedAt` datetime(6) NOT NULL,
        `UpdatedAt` datetime(6) NOT NULL,
        `LastIngestedAt` datetime(6) NOT NULL,
        `ExpiresAt` datetime(6) NOT NULL,
        CONSTRAINT `PK_Indicators` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `Permissions` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Name` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Group` longtext CHARACTER SET utf8mb4 NULL,
        `Description` longtext CHARACTER SET utf8mb4 NULL,
        CONSTRAINT `PK_Permissions` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `Roles` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Name` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Description` longtext CHARACTER SET utf8mb4 NULL,
        `IsBuiltIn` tinyint(1) NOT NULL,
        CONSTRAINT `PK_Roles` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `RuleChanges` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `SignatureId` bigint NOT NULL,
        `ChangesCorrelationId` char(36) COLLATE ascii_general_ci NOT NULL,
        `SignatureRev` bigint NOT NULL,
        `ChangeType` int NOT NULL,
        `ChangedItem` int NOT NULL,
        `OldValue` longtext CHARACTER SET utf8mb4 NULL,
        `NewValue` longtext CHARACTER SET utf8mb4 NULL,
        `CreatedBy` varchar(255) CHARACTER SET utf8mb4 NULL,
        `CreatedAt` datetime(6) NOT NULL,
        CONSTRAINT `PK_RuleChanges` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `Settings` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Group` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Name` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Value` longtext CHARACTER SET utf8mb4 NULL,
        `UpdatedAt` datetime(6) NOT NULL,
        CONSTRAINT `PK_Settings` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `database_version_history` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Version` varchar(255) CHARACTER SET utf8mb4 NULL,
        `UpdatedAt` datetime(6) NOT NULL,
        CONSTRAINT `PK_database_version_history` PRIMARY KEY (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `IDSRules` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `SignatureSourceCode` longtext CHARACTER SET utf8mb4 NULL,
        `SignatureAction` varchar(255) CHARACTER SET utf8mb4 NULL,
        `SignatureMessage` longtext CHARACTER SET utf8mb4 NULL,
        `SignatureId` bigint NOT NULL,
        `SignatureRev` bigint NOT NULL,
        `SignatureClasstype` longtext CHARACTER SET utf8mb4 NULL,
        `SignaturePriority` bigint NULL,
        `SignatureTarget` longtext CHARACTER SET utf8mb4 NULL,
        `SignatureThreshold` longtext CHARACTER SET utf8mb4 NULL,
        `Status` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
        `Software` longtext CHARACTER SET utf8mb4 NULL,
        `CategoryId` bigint NULL,
        `WhereToDeploy` int NOT NULL,
        `CreatedAt` datetime(6) NOT NULL,
        `UpdatedAt` datetime(6) NOT NULL,
        CONSTRAINT `PK_IDSRules` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_IDSRules_Categories_CategoryId` FOREIGN KEY (`CategoryId`) REFERENCES `Categories` (`Id`)
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `ConfGroups` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Name` longtext CHARACTER SET utf8mb4 NOT NULL,
        `Description` longtext CHARACTER SET utf8mb4 NULL,
        `ClusterId` bigint NOT NULL,
        CONSTRAINT `PK_ConfGroups` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_ConfGroups_Clusters_ClusterId` FOREIGN KEY (`ClusterId`) REFERENCES `Clusters` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `ClusterConfProfile` (
        `ClusterId` bigint NOT NULL,
        `ConfProfileId` bigint NOT NULL,
        CONSTRAINT `PK_ClusterConfProfile` PRIMARY KEY (`ClusterId`, `ConfProfileId`),
        CONSTRAINT `FK_ClusterConfProfile_Cluster_ClusterId` FOREIGN KEY (`ClusterId`) REFERENCES `Clusters` (`Id`) ON DELETE RESTRICT,
        CONSTRAINT `FK_ClusterConfProfile_ConfProfile_ConfProfileId` FOREIGN KEY (`ConfProfileId`) REFERENCES `ConfigurationProfiles` (`Id`) ON DELETE RESTRICT
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `IndicatorAttributes` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Type` int NOT NULL,
        `Name` varchar(1024) CHARACTER SET utf8mb4 NULL,
        `Value` varchar(1024) CHARACTER SET utf8mb4 NULL,
        `CreatedAt` datetime(6) NOT NULL,
        `UpdatedAt` datetime(6) NOT NULL,
        `IndicatorId` bigint NOT NULL,
        CONSTRAINT `PK_IndicatorAttributes` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_IndicatorAttributes_Indicators_IndicatorId` FOREIGN KEY (`IndicatorId`) REFERENCES `Indicators` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `RolePermissions` (
        `RoleId` bigint NOT NULL,
        `PermissionId` bigint NOT NULL,
        CONSTRAINT `PK_RolePermissions` PRIMARY KEY (`RoleId`, `PermissionId`),
        CONSTRAINT `FK_RolePermissions_Permissions_PermissionId` FOREIGN KEY (`PermissionId`) REFERENCES `Permissions` (`Id`) ON DELETE CASCADE,
        CONSTRAINT `FK_RolePermissions_Roles_RoleId` FOREIGN KEY (`RoleId`) REFERENCES `Roles` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `UserRoles` (
        `UserId` bigint NOT NULL,
        `RoleId` bigint NOT NULL,
        CONSTRAINT `PK_UserRoles` PRIMARY KEY (`UserId`, `RoleId`),
        CONSTRAINT `FK_UserRoles_Roles_RoleId` FOREIGN KEY (`RoleId`) REFERENCES `Roles` (`Id`) ON DELETE CASCADE,
        CONSTRAINT `FK_UserRoles_Users_UserId` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `IDSRuleCluster` (
        `ClusterId` bigint NOT NULL,
        `IDSRuleId` bigint NOT NULL,
        CONSTRAINT `PK_IDSRuleCluster` PRIMARY KEY (`ClusterId`, `IDSRuleId`),
        CONSTRAINT `FK_IDSRuleCluster_Cluster_ClusterId` FOREIGN KEY (`ClusterId`) REFERENCES `Clusters` (`Id`) ON DELETE CASCADE,
        CONSTRAINT `FK_IDSRuleCluster_IDSRule_IDSRuleId` FOREIGN KEY (`IDSRuleId`) REFERENCES `IDSRules` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `RuleAttributes` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Type` int NOT NULL,
        `Name` varchar(255) CHARACTER SET utf8mb4 NULL,
        `Value` varchar(255) CHARACTER SET utf8mb4 NULL,
        `IDSRuleId` bigint NOT NULL,
        CONSTRAINT `PK_RuleAttributes` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_RuleAttributes_IDSRules_IDSRuleId` FOREIGN KEY (`IDSRuleId`) REFERENCES `IDSRules` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `RuleSources` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Name` varchar(255) CHARACTER SET utf8mb4 NULL,
        `CreatedAt` datetime(6) NOT NULL,
        `UpdatedAt` datetime(6) NULL,
        `IDSRuleId` bigint NOT NULL,
        CONSTRAINT `PK_RuleSources` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_RuleSources_IDSRules_IDSRuleId` FOREIGN KEY (`IDSRuleId`) REFERENCES `IDSRules` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE TABLE `ConfSets` (
        `Id` bigint NOT NULL AUTO_INCREMENT,
        `Notes` longtext CHARACTER SET utf8mb4 NULL,
        `Version` bigint NOT NULL,
        `ConfGroupId` bigint NOT NULL,
        CONSTRAINT `PK_ConfSets` PRIMARY KEY (`Id`),
        CONSTRAINT `FK_ConfSets_ConfGroups_ConfGroupId` FOREIGN KEY (`ConfGroupId`) REFERENCES `ConfGroups` (`Id`) ON DELETE CASCADE
    ) CHARACTER SET=utf8mb4;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_Categories_ParentCategoryId` ON `Categories` (`ParentCategoryId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_ClusterConfProfile_ConfProfileId` ON `ClusterConfProfile` (`ConfProfileId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_ConfGroups_ClusterId` ON `ConfGroups` (`ClusterId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_ConfSets_ConfGroupId` ON `ConfSets` (`ConfGroupId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_ConfigurationProfiles_Name_Version_TargetSoftware` ON `ConfigurationProfiles` (`Name`, `Version`, `TargetSoftware`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IDSRuleCluster_IDSRuleId` ON `IDSRuleCluster` (`IDSRuleId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IDSRules_CategoryId` ON `IDSRules` (`CategoryId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IDSRules_SignatureAction` ON `IDSRules` (`SignatureAction`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_IDSRules_SignatureId_SignatureRev` ON `IDSRules` (`SignatureId`, `SignatureRev`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IDSRules_Status` ON `IDSRules` (`Status`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IndicatorAttributes_IndicatorId` ON `IndicatorAttributes` (`IndicatorId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IndicatorAttributes_Name` ON `IndicatorAttributes` (`Name`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IndicatorAttributes_Type` ON `IndicatorAttributes` (`Type`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_IndicatorAttributes_Value` ON `IndicatorAttributes` (`Value`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_Indicators_Score` ON `Indicators` (`Score`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_Indicators_Status` ON `Indicators` (`Status`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_Indicators_Type` ON `Indicators` (`Type`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_Indicators_Value` ON `Indicators` (`Value`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_Permissions_Name` ON `Permissions` (`Name`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RolePermissions_PermissionId` ON `RolePermissions` (`PermissionId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_RolePermissions_RoleId_PermissionId` ON `RolePermissions` (`RoleId`, `PermissionId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_Roles_Name` ON `Roles` (`Name`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleAttributes_IDSRuleId` ON `RuleAttributes` (`IDSRuleId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleAttributes_Name` ON `RuleAttributes` (`Name`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleAttributes_Type` ON `RuleAttributes` (`Type`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleAttributes_Value` ON `RuleAttributes` (`Value`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_ChangeType` ON `RuleChanges` (`ChangeType`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_ChangedItem` ON `RuleChanges` (`ChangedItem`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_ChangesCorrelationId` ON `RuleChanges` (`ChangesCorrelationId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_CreatedAt` ON `RuleChanges` (`CreatedAt`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_CreatedBy` ON `RuleChanges` (`CreatedBy`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_Id` ON `RuleChanges` (`Id`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_SignatureId` ON `RuleChanges` (`SignatureId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleChanges_SignatureRev` ON `RuleChanges` (`SignatureRev`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE INDEX `IX_RuleSources_IDSRuleId` ON `RuleSources` (`IDSRuleId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_RuleSources_Name_IDSRuleId` ON `RuleSources` (`Name`, `IDSRuleId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_Settings_Group_Name` ON `Settings` (`Group`, `Name`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_UserRoles_RoleId_UserId` ON `UserRoles` (`RoleId`, `UserId`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    CREATE UNIQUE INDEX `IX_database_version_history_Version` ON `database_version_history` (`Version`);

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    INSERT INTO `database_version_history` (`Version`, `UpdatedAt`) VALUES ('2.8.0', NOW());

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

DROP PROCEDURE IF EXISTS MigrationsScript;
DELIMITER //
CREATE PROCEDURE MigrationsScript()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM `__EFMigrationsHistory` WHERE `MigrationId` = '20241128151942_InitialCreateV2.8.0') THEN

    INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
    VALUES ('20241128151942_InitialCreateV2.8.0', '8.0.11');

    END IF;
END //
DELIMITER ;
CALL MigrationsScript();
DROP PROCEDURE MigrationsScript;

COMMIT;
