One to many relationship in view #757
-
When I try to define the view table as one has many relationship. It has this issue. Is there a way to fix this? Or we can not use one has many relation with view ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
|
No, you cannot create a hasMany relation on a virtualized view because virtual views do not support indexes on foreign keys. In Contember, this results in an error when trying to create such a relation. However, the new |
Beta Was this translation helpful? Give feedback.
-
|
Hi, what changes have you made to the |
Beta Was this translation helpful? Give feedback.
-
|
Is the version v2.1.0-alpha.6 stable to use for the production application ? |
Beta Was this translation helpful? Give feedback.
No, you cannot create a hasMany relation on a virtualized view because virtual views do not support indexes on foreign keys. In Contember, this results in an error when trying to create such a relation. However, the new
materializedoption introduced in the latest version of Contember allows you to define hasMany relations on views. Materialized views are stored as actual tables, so they can support indexes, but you'll need to refresh them manually. For more details, please refer to PR #748.