DataMapper: In-table Foreign Key with non-standard name |
[eluser]Genki1[/eluser]
Scenario: I have a one-to-many relationship with an in-table foreign key (ITFK) which has a non-standard name. I have modified the models as explained in Advanced Relationships in the section, "You want to use alternative name for a foreign key column name." Issue: DataMapper complains that a join table cannot be found: Quote:Error 1146: table 'accounts_lookups' does't exist". Filename: libraries/datamapper.php. Line Number: 1470. My tables: Table "accounts": Code: id Table "lookups": Code: id My models: account.php: Code: class Account extends DataMapper { lookup.php: Code: class Lookup extends DataMapper { The documentation for "You want to use alternative name for a foreign key column name" mentions only to use the attributes "join_self_as" and "join_other_as". Since I'm getting an error I guess more is needed, but the solution is not clear to me. |
Messages In This Thread |
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 04-30-2012, 12:26 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 04-30-2012, 02:41 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 04-30-2012, 03:07 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 05-01-2012, 01:02 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 05-01-2012, 04:22 AM
|