This question is simplified to reduce clutter.
In my database I have 2 tables. 1 table "product" and 1 table "notification".
This product can be of 3 types, defined by an enum ( ENUM('SERVER', 'SERVICE', 'APPLICATION')
).
Notification contains a ForeignKey of product, its ID.
When I create a notification I would like to check if the given ForeignKey is of the type 'APPLICATION'. Am I able to perform such a check? If so, is this done by a CHECK
?
As far as I know, the only thing I could CHECK is an value (e.g. CHECK(foo > 0)
)