Skip to content

Instantly share code, notes, and snippets.

@joebrislin
Created October 3, 2012 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joebrislin/3827262 to your computer and use it in GitHub Desktop.
Save joebrislin/3827262 to your computer and use it in GitHub Desktop.
ColdFusion ORM - Extra Column being generated in link table
component{
property name="users" fieldtype="many-to-many" cfc="users" singularname="user"
type="array" linktable="tblUsers_Roles" cascade="none"
fkcolumnid="roleID" inversejoincolumn="accountID";
}
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$$
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