ALTER TABLE messages
    ADD FOREIGN KEY (channel_id) REFERENCES channels(id) ON DELETE CASCADE,
    ADD FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE,
    ADD FOREIGN KEY (guild_id) REFERENCES guilds(id) ON DELETE CASCADE,
    ADD FOREIGN KEY (reply_message_id) REFERENCES messages(id) ON DELETE SET NULL