remove a foreign key dependency

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

remove a foreign key dependency

Patrick-4
When I place an order I want to remove the facility dependency, so I
commented out the following: and did a restart, but when I place an
order it still requires the dependency so I guess it didn't update.
Is there a special command to verify and update the DB from a modified
entitymodel.xml file ?   Thanks

   <entity entity-name="OrderHeader"
            package-name="org.ofbiz.order.order"
            never-cache="true"
            title="Order Header Entity">

     <!--  commented this out
      <relation type="one" fk-name="ORDER_HDR_OFAC" title="Origin"
rel-entity-name="FacilityAndContactMechAndAddress1">
        <key-map field-name="originFacilityId" rel-field-name="facilityId"/>
      </relation>
       -->
Reply | Threaded
Open this post in threaded view
|

Re: remove a foreign key dependency

Jacques Le Roux
Administrator
Look for "Check/Update Database" in Webtools

Jacques

From: "Patrick" <[hidden email]>

> When I place an order I want to remove the facility dependency, so I
> commented out the following: and did a restart, but when I place an
> order it still requires the dependency so I guess it didn't update.
> Is there a special command to verify and update the DB from a modified
> entitymodel.xml file ?   Thanks
>
>   <entity entity-name="OrderHeader"
>            package-name="org.ofbiz.order.order"
>            never-cache="true"
>            title="Order Header Entity">
>
>     <!--  commented this out
>      <relation type="one" fk-name="ORDER_HDR_OFAC" title="Origin"
> rel-entity-name="FacilityAndContactMechAndAddress1">
>        <key-map field-name="originFacilityId" rel-field-name="facilityId"/>
>      </relation>
>       -->
>

Reply | Threaded
Open this post in threaded view
|

Re: remove a foreign key dependency

Patrick-4
I ran a check, and it removed the dependency from webtools entity
reference, eg. searching for ORDER_HDR_OFAC gives no results, but when
I try to update an OrderHeader it still breaks saying INSERT on table
'ORDER_HEADER' caused a violation of foreign key constraint
'ORDER_HDR_OFAC' for key (10061)  Do you have any suggestions ?

On Mon, Apr 12, 2010 at 8:03 AM, Jacques Le Roux
<[hidden email]> wrote:

> Look for "Check/Update Database" in Webtools
>
> Jacques
>
> From: "Patrick" <[hidden email]>
>>
>> When I place an order I want to remove the facility dependency, so I
>> commented out the following: and did a restart, but when I place an
>> order it still requires the dependency so I guess it didn't update.
>> Is there a special command to verify and update the DB from a modified
>> entitymodel.xml file ?   Thanks
>>
>>  <entity entity-name="OrderHeader"
>>           package-name="org.ofbiz.order.order"
>>           never-cache="true"
>>           title="Order Header Entity">
>>
>>    <!--  commented this out
>>     <relation type="one" fk-name="ORDER_HDR_OFAC" title="Origin"
>> rel-entity-name="FacilityAndContactMechAndAddress1">
>>       <key-map field-name="originFacilityId" rel-field-name="facilityId"/>
>>     </relation>
>>      -->
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: remove a foreign key dependency

Patrick-4
I just used a SQL command in the webform to alter a table, that
worked.  Thanks for your help. :)

On Mon, Apr 12, 2010 at 8:28 AM, Patrick <[hidden email]> wrote:

> I ran a check, and it removed the dependency from webtools entity
> reference, eg. searching for ORDER_HDR_OFAC gives no results, but when
> I try to update an OrderHeader it still breaks saying INSERT on table
> 'ORDER_HEADER' caused a violation of foreign key constraint
> 'ORDER_HDR_OFAC' for key (10061)  Do you have any suggestions ?
>
> On Mon, Apr 12, 2010 at 8:03 AM, Jacques Le Roux
> <[hidden email]> wrote:
>> Look for "Check/Update Database" in Webtools
>>
>> Jacques
>>
>> From: "Patrick" <[hidden email]>
>>>
>>> When I place an order I want to remove the facility dependency, so I
>>> commented out the following: and did a restart, but when I place an
>>> order it still requires the dependency so I guess it didn't update.
>>> Is there a special command to verify and update the DB from a modified
>>> entitymodel.xml file ?   Thanks
>>>
>>>  <entity entity-name="OrderHeader"
>>>           package-name="org.ofbiz.order.order"
>>>           never-cache="true"
>>>           title="Order Header Entity">
>>>
>>>    <!--  commented this out
>>>     <relation type="one" fk-name="ORDER_HDR_OFAC" title="Origin"
>>> rel-entity-name="FacilityAndContactMechAndAddress1">
>>>       <key-map field-name="originFacilityId" rel-field-name="facilityId"/>
>>>     </relation>
>>>      -->
>>>
>>
>>
>