CREATE TABLE `dc_errors_dropdown` (
  `ID_LNK` int(11) NOT NULL,
  `ErrorID_LNK` int(11) NOT NULL,
  `DropdownID_LNK` int(11) NOT NULL,
  `Deleted` int(1) NOT NULL
);


ALTER TABLE `dc_errors_dropdown`
  ADD PRIMARY KEY (`ID_LNK`);
ALTER TABLE `dc_errors_dropdown`
  MODIFY `ID_LNK` int(11) NOT NULL AUTO_INCREMENT;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`PotentialOutcomeID`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`LicensedStatus`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`ProductStage`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`ErrorType`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`ErrorStage`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`Factor`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

INSERT INTO dc_errors_dropdown(ErrorID_LNK, DropdownID_LNK, Deleted)
SELECT `ID_LNK`,`Severity`, dc_errors.Deleted FROM `dc_errors` WHERE dc_errors.Deleted = 0;

 ALTER TABLE `dc_errors`
  DROP `PotentialOutcomeID`,
  DROP `LicensedStatus`,
  DROP `ProductStage`,
  DROP `ErrorType`,
  DROP `ErrorStage`,
  DROP `Factor`,
  DROP `Severity`;