CREATE TABLE `product_params1` (
  `ID` int(10) UNSIGNED NOT NULL,
  `ProductID` int(10) UNSIGNED NOT NULL,
  `ParamID` int(10) UNSIGNED NOT NULL,
  `ParamValue` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

ALTER TABLE `product_params1`
  ADD PRIMARY KEY (`ID`),
  ADD UNIQUE KEY `Uni` (`ProductID`,`ParamID`,`ParamValue`) USING BTREE,
  ADD KEY `ProductID` (`ProductID`) USING BTREE;

ALTER TABLE `product_params1`
  MODIFY `ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;


INSERT INTO `product_params1`
SELECT * FROM `product_params` WHERE `ProductID` IN (SELECT `ID` FROM `products1`);