Heloo,
I just beginner with yii2 and postgresql. I have problem like this:
First table:
tbl_printer (PK dept_id and id)
| dept_id | id | name |
Second table
tbl_printer_group (PK dept_id and id)
| dept_id | id | printer1 | printer2 | printer3 |
printer1
, printer2
, printer3
data/value from tbl_printer.id
I want to 'DISALLOWED to DELETE' tbl_printer
IF printer (id) STILL IN USE at tbl_printer_group
(printer1,printer2,printer3). If not wrong foreign key, one to one from parent to child, but this one to many.
How to solve this problem, I'm using php, yii2 and postgresql.
Thanks and sorry for my english