createForeignKey('adult', array ( 'local' => 'contact_id', 'foreign' => 'id', 'foreignTable' => 'contact', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'adult_contact_contact_id_id', )); $this->createForeignKey('child', array ( 'local' => 'adult_id', 'foreign' => 'id', 'foreignTable' => 'adult', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'child_adult_adult_id_id', )); $this->createForeignKey('dog', array ( 'local' => 'user_id', 'foreign' => 'id', 'foreignTable' => 'user', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'dog_user_user_id_id', )); $this->createForeignKey('self_reference', array ( 'local' => 'user_id1', 'foreign' => 'id', 'foreignTable' => 'user', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'self_reference_user_user_id1_id', )); $this->createForeignKey('self_reference', array ( 'local' => 'user_id2', 'foreign' => 'id', 'foreignTable' => 'user', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'self_reference_user_user_id2_id', )); $this->createForeignKey('self_reference', array ( 'local' => 'parent_self_reference_id', 'foreign' => 'id', 'foreignTable' => 'self_reference', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'self_reference_self_reference_parent_self_reference_id_id', )); $this->createForeignKey('self_reference', array ( 'local' => 'parent_self_reference_id2', 'foreign' => 'id', 'foreignTable' => 'self_reference', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'self_reference_self_reference_parent_self_reference_id2_id', )); $this->createForeignKey('user', array ( 'local' => 'contact_id', 'foreign' => 'id', 'foreignTable' => 'contact', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'user_contact_contact_id_id', )); $this->createForeignKey('user_car', array ( 'local' => 'user_id', 'foreign' => 'id', 'foreignTable' => 'user', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'user_car_user_user_id_id', )); $this->createForeignKey('user_car', array ( 'local' => 'car_id', 'foreign' => 'id', 'foreignTable' => 'car', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'user_car_car_car_id_id', )); $this->createForeignKey('user_group', array ( 'local' => 'user_id', 'foreign' => 'id', 'foreignTable' => 'user', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'user_group_user_user_id_id', )); $this->createForeignKey('user_group', array ( 'local' => 'group_id', 'foreign' => 'id', 'foreignTable' => 'groups', 'onUpdate' => NULL, 'onDelete' => NULL, 'name' => 'user_group_groups_group_id_id', )); } public function down() { $this->dropForeignKey('adult', 'adult_contact_contact_id_id'); $this->dropForeignKey('child', 'child_adult_adult_id_id'); $this->dropForeignKey('dog', 'dog_user_user_id_id'); $this->dropForeignKey('self_reference', 'self_reference_user_user_id1_id'); $this->dropForeignKey('self_reference', 'self_reference_user_user_id2_id'); $this->dropForeignKey('self_reference', 'self_reference_self_reference_parent_self_reference_id_id'); $this->dropForeignKey('self_reference', 'self_reference_self_reference_parent_self_reference_id2_id'); $this->dropForeignKey('user', 'user_contact_contact_id_id'); $this->dropForeignKey('user_car', 'user_car_user_user_id_id'); $this->dropForeignKey('user_car', 'user_car_car_car_id_id'); $this->dropForeignKey('user_group', 'user_group_user_user_id_id'); $this->dropForeignKey('user_group', 'user_group_groups_group_id_id'); } }