Hey Forrest, I confirm this same issue on the trunk. It seems foreign keys are not currently handled by extend-entity. I encountered this issue a while back but didn't to create an issue for it and manually created the relation in the database server.
+1 to create a JIRA On Tue, 2015-06-09 at 17:20 -0700, Forrest Rae wrote: > Hi Everyone, > > I'm having a heck of a time trying to get this to work. I have a list > of business specific codes I want to apply to a quote. It's a large > list that changes, so Enumeration wouldn't be right for me here. > > For the life of me, I can not figure out why there is no foreign key > constraint created in the Postgres database for the relation on Quote. > I'm using a database that has some quote data in it already, but I did > try deleting all the quote records, extending the entity, and then > adding the records back in via <entity-engine-xml>. > > Nothing I've tried results in a FK constraint being created at the > database level. Any ideas? > > <entity entity-name="MyCode" > package-name="org.ofbiz.common.my" > title="Classification Code Data Object Entity"> > <field name="code" type="id-ne"></field> > <field name="description" type="description"></field> > <field name="fromDate" type="date-time"></field> > <field name="thruDate" type="date-time"></field> > <prim-key field="code"/> > </entity> > > <extend-entity entity-name="Quote"> > <field name="myCode" type="id-ne" not-null="true"/> > <relation type="one" fk-name="QUOTE_MY" rel-entity-name="MyCode"> > <key-map field-name="myCode" rel-field-name="code"/> > </relation> > </extend-entity> > > -Forrest
