Should fix the foreign key error we've been getting. Adds a ParentChannelId column to GuildChannels, stores a value in this column whenever we try to track a thread. Updates queries that reference messages or channels to use the ChannelId or ParentChannelId as needed (so for example, when we count user participation we count messages in forum threads toward the total message count of the forum itself).
Should fix the foreign key error we've been getting. Adds a ParentChannelId column to GuildChannels, stores a value in this column whenever we try to track a thread. Updates queries that reference messages or channels to use the ChannelId or ParentChannelId as needed (so for example, when we count user participation we count messages in forum threads toward the total message count of the forum itself).