<commit_before>-- With Team Product we need to have seperate notifications for each group.
-- For this reason we have added context_channel_id column
DO $$
  BEGIN
    BEGIN
      ALTER TABLE notification.notification ADD COLUMN context_channel_id BIGINT NOT NULL;
    EXCEPTION
      WHEN duplicate_column THEN RAISE NOTICE 'column already exists';
    END;
  END;
$$;<commit_msg>notification: add koding group channel id as default context channel id<commit_after>-- With Team Product we need to have seperate notifications for each group.
-- For this reason we have added context_channel_id column
CREATE OR REPLACE FUNCTION get_koding_group_channel() RETURNS BIGINT AS $$
DECLARE koding_channel_id BIGINT;

BEGIN
  SELECT into koding_channel_id (SELECT id FROM api.channel WHERE type_constant = 'group' AND group_name = 'koding' LIMIT 1);
  RETURN koding_channel_id;
END;
$$ LANGUAGE plpgsql;

DO $$
  BEGIN
    BEGIN
      ALTER TABLE notification.notification ADD COLUMN context_channel_id BIGINT NOT NULL DEFAULT get_koding_group_channel();
    EXCEPTION
      WHEN duplicate_column THEN RAISE NOTICE 'column already exists';
    END;
  END;
$$;

{'fraction_non_alphanumeric': 0.05464006938421509, 'fraction_numerical': 0.0008673026886383347, 'mean_word_length': 4.317972350230415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5399550', 'n_tokens_mistral': 342, 'n_tokens_neox': 320, 'n_words': 132}