I have a cad_address
table with my users' address record. I also have another request table mov_order
that has a foreign key address_id
for the address table, responsible for the relationship.
The problem is that when the face refreshes the address, it also updates the request address (due to the relationship). Because of this, we are creating a snapshot of the address in the order table, with all address data, now also in the request (a replica).
Now in the order status we will no longer search the customer's address for the relationship, but directly in the order table, then having the address that was registered at the time of purchase. We use the foreign key address_id
, to migrate the data from the customer address to the order table.
However, we feel now that the order table has gotten a little dirty. The fact is, we have a column address_id
, setting a relationship that is not being used for anything. And this relationship can confuse developers, not to mention that it can open a loophole for someone to do a little 'crap', call a relationship that is no longer being used ...
The question is: Is it correct to remove this column? Or should one keep it?