In my customers entity, I have a field called “Customer Group” which is linked to a code lookup generic table which contains codes/descriptions.
Although this sounds very easy and straightforward to implement, I am facing the following issue:
I have set the attribute to association (as per attached snapshot). When I update database, I get the error shown in Error1 snapshot. This is because the field Customer_Group_Id is created as integer (for a reason that I dont know) and it is a foreign key linked to the ID of Codelkup table which is varchar(32). How can we set the datatype of the association field?
To overcome this issue, I manually changed the type of Customer_Group_Id to varchar(32) on the physical table. In this case, I get the error shown in Error2 snapshot. Why is it trying to remove the constraint used by the foreign key? I am so confused about this behavior.
Appreciate your prompt feedback.