Migration that adds foreign keys with ON DELETE CASCADE from the character_id column of the character_permissions and character_temp_permissions tables to characters, so that the database deletes the permissions of a character together with it, also when the character is deleted along with its user rather than by the plugin. The rows that belong to characters that do not exist are deleted first.

The admin plugin also runs without the Characters plugin, so the foreign keys are only added if the characters table exists when the migration runs. Without them, the plugin still deletes the permissions of a character that a player deletes.

Summary

Methods

down()shared
Removes the foreign keys, if they were added.
up()shared
Deletes the permissions of characters that do not exist and adds the foreign keys, if the characters table exists.

Methods

Removes the foreign keys, if they were added.

Deletes the permissions of characters that do not exist and adds the foreign keys, if the characters table exists.

Defined in