ALTER TABLE channels
    ADD FOREIGN KEY (guild_id) REFERENCES guilds(id) ON DELETE CASCADE,
    ADD FOREIGN KEY (parent_id) REFERENCES channels(id) ON DELETE SET NULL,
    ADD FOREIGN KEY (thread_owner_id) REFERENCES users(id) ON DELETE SET NULL
