According this documentation page (Association Relationship), it seems that CodeFluent Entities generate Foreign keys in NOCHECK
mode by default on One to Many and Many to Many relations. On the other hand, the Foreign keys on One to One relations are created in CHECK mode.
I have several questions about that:
- My understanding is that
NOCHECK
foreign keys are disabled. If so, what is the purpose of creating all that disabled foreign keys ? - Is there a way (and an interest) to change that behaviour?
- We have some One to One relations on our application but still, all the foreign keys are disabled on our database. Why is it so ?
thanks by advance.
The foreign keys gives you some informations about the scheme even if there are not enforced. Also it can be convenient during development to not get integrity errors when you update the database. In the documentation, it is said that it's for performance reasons, but I'm really not sure about this one.
Anyway, you can instruct CodeFluent Entities to check constraint by setting
defaultPersistenceEnforce="true"
on the projectFrom the documentation