deesoft / yii2-gii

Yii2 custom generator fo gii

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple foreign keys to same table only one saved

drsdre opened this issue · comments

commented

Hi,

Unfortunately when two fields in a table have a foreign key reference to the same table, only one is added. For example if there are two fields in a mapping table:

  • source_record_id => foreign key to record->id
  • destination_record_id => foreign key to record->id

only one foreign key is added:
'FOREIGN KEY ([[destination_record_id]]) REFERENCES record ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE',