The problem appears when create a new database from code calling the CreateDatabase().
When creating a database from Entity Developer and from program code the database are different.
This is a very critical issue for me! In tested now with MySQL.
When use CreateDatabase():
1) Do not create DEFAULT settings.
Code: Select all
- `IsOut` tinyint(1) NOT NULL DEFAULT '0',
+ `IsOut` tinyint(1) NOT NULL,
Code: Select all
- KEY `FK_Users_UserGrants` (`UserGrantId`),
- KEY `FK_Users_RefUserType` (`UserTypeId`),
- CONSTRAINT `FK_Users_UserGrants` FOREIGN KEY (`UserGrantId`) REFERENCES `usergrants` (`UserGrantId`) ON DELETE SET NULL,
- CONSTRAINT `FK_Users_RefUserType` FOREIGN KEY (`UserTypeId`) REFERENCES `refusertypes` (`UserTypeId`) ON DELETE CASCADE
+ KEY `FK_Users_UserGrants_0` (`UserGrantId`),
+ KEY `FK_Users_RefUserTypes_1` (`UserTypeId`),
+ CONSTRAINT `FK_Users_UserGrants_0` FOREIGN KEY (`UserGrantId`) REFERENCES `usergrants` (`UserGrantId`) ON DELETE SET NULL,
+ CONSTRAINT `FK_Users_RefUserTypes_1` FOREIGN KEY (`UserTypeId`) REFERENCES `refusertypes` (`UserTypeId`) ON DELETE CASCADE