One of my colleague designed a table schema, and in one of the tables a column can references primary keys in different tables depends on value of another column. I know it is differently wrong, but can not find theory to support me. His schema like this:
table video: (id, name, ...)
table audio:(id, name, ...)
table review_item( item_type, item_id, reason, ...)
when item_type='V', then item_id is id of table video and when item_type='A' then item_id is id in table video
The combination of (item_type, item_id) is unique, but actually it is not a foreign key at all, you can not define it as foreign key as it does not point to a single table. DDL syntax does not allow it.
Can someone find out which principle or rules are violated here?