mysql2sqlite icon indicating copy to clipboard operation
mysql2sqlite copied to clipboard

Wrong Constraints

Open raphaelquati opened this issue 8 years ago • 0 comments

CREATE TABLE `measurement_logs` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `UserId` int(11) DEFAULT NULL,
  `CreatedOn` datetime NOT NULL,
  `MeasuringPointId` int(11) NOT NULL,
  `StartDate` datetime NOT NULL,
  `EndDate` datetime NOT NULL,
  `Complete` int(11) NOT NULL,
  `Incomplete` int(11) NOT NULL,
  `Zeroed` int(11) NOT NULL,
  `Missing` int(11) NOT NULL,
  `ImportType` int(11) NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `IX_MeasuringPointId` (`MeasuringPointId`) USING HASH,
  CONSTRAINT `FK_measurement_logs_measuringpoints_MeasuringPointId` FOREIGN KEY (`MeasuringPointId`) REFERENCES `measuringpoints` (`MeasuringPointId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=190 DEFAULT CHARSET=latin1;

Is converted to:

CREATE TABLE `measurement_logs` (
  `Id` integer NOT NULL PRIMARY KEY AUTOINCREMENT
,  `UserId` integer DEFAULT NULL
,  `CreatedOn` datetime NOT NULL
,  `MeasuringPointId` integer NOT NULL
,  `StartDate` datetime NOT NULL
,  `EndDate` datetime NOT NULL
,  `Complete` integer NOT NULL
,  `Incomplete` integer NOT NULL
,  `Zeroed` integer NOT NULL
,  `Missing` integer NOT NULL
,  `ImportType` integer NOT NULL
,  CONSTRAINT `FK_measurement_logs_measuringpoints_MeasuringPointId` FOREIGN KEY (`MeasuringPointId`) REFERENCES `measuringpoints` **integer** ON DELETE CASCADE ON UPDATE CASCADE
);


Wrong referecence.

raphaelquati avatar Jan 29 '18 16:01 raphaelquati