Migration that adds foreign keys with ON DELETE CASCADE from the character_id and target_id columns of the recognizes table to characters, along with an index on each column, so that the database deletes the recognitions a character has and those of it together with the character, also when the character is deleted along with its user. The rows that name a character that does not exist are deleted first.

Summary

Methods

down()shared
Removes the foreign keys and the indexes.
up()shared
Deletes the recognitions of characters that do not exist, and adds the indexes and the foreign keys.

Methods

Removes the foreign keys and the indexes.

Deletes the recognitions of characters that do not exist, and adds the indexes and the foreign keys.

Defined in