Created
October 3, 2012 14:38
-
-
Save joebrislin/3827262 to your computer and use it in GitHub Desktop.
ColdFusion ORM - Extra Column being generated in link table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component{ | |
property name="users" fieldtype="many-to-many" cfc="users" singularname="user" | |
type="array" linktable="tblUsers_Roles" cascade="none" | |
fkcolumnid="roleID" inversejoincolumn="accountID"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `tblusers_roles` ( | |
`accountID` bigint(20) NOT NULL, | |
`roleID` int(11) NOT NULL, | |
`roles_roleID` int(11) NOT NULL, | |
KEY `FK3E0D2F08CF51D6CE` (`roleID`), | |
KEY `FK3E0D2F0899C04E10` (`accountID`), | |
KEY `FK3E0D2F08A529A690` (`roles_roleID`), | |
CONSTRAINT `FK3E0D2F0899C04E10` FOREIGN KEY (`accountID`) REFERENCES `tblusers` (`accountID`), | |
CONSTRAINT `FK3E0D2F08A529A690` FOREIGN KEY (`roles_roleID`) REFERENCES `tblroles` (`roleID`), | |
CONSTRAINT `FK3E0D2F08CF51D6CE` FOREIGN KEY (`roleID`) REFERENCES `tblroles` (`roleID`) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component{ | |
property name="roles" fieldtype="many-to-many" cfc="roles" singularname="role" | |
type="array" orderby="roleName asc" cascade="all" | |
linktable="tblUsers_Roles" fkcolumn="accountID" inversejoincolumn="roleID" inverse="true"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment