Ticket #173 (new defect)
Opened 4 months ago
Generated files contain errors if tables use same PK (e.g. "id")
| Reported by: | snarfblat | Owned by: | dhughes |
|---|---|---|---|
| Type: | defect | Priority: | high |
| Milestone: | Component: | Documentation | |
| Version: | Severity: | blocker | |
| Keywords: | Cc: |
Description
If all of your tables use the same term for the PK -- e.g. let's say "ID", the generated files will contain duplicate cffunction names.
Example... all of my tables used ID as the PK. I defined them like this:
<object name="users">
<hasOne name="id">
<relate from="id" to="userid" />
</hasOne>
</object>
<object name="usertypes">
<hasOne name="id">
<relate from="id" to="usertypeid" />
</hasOne>
</object>
(etc)
Then I end up with multiple cffunctions named "setid" and therefore an error is thrown.
Even if I changed the relate tag to from=userid to=userid, I still get the error. Only after I went into the db and changed the fields to "userid" and "usertypeid" did the error go away.

