<commit_before>-- Deploy mappamundi:dev to pg

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";



-- for these three columns we never let the caller control the contents
CREATE OR REPLACE FUNCTION mappa.override_ipsative_response_columns()
RETURNS TRIGGER AS $$
BEGIN
  IF NEW.uuid IS NOT NULL THEN
    RAISE EXCEPTION 'You must not send uuid field';
  ELSE
    NEW.uuid = mappa.uuid_generate_v4();
  END IF;
  IF NEW.created_at IS NOT NULL THEN
    RAISE EXCEPTION 'You must not send created_at field';
  ELSE
    NEW.created_at = now();
  END IF;
  IF NEW.user_email IS NOT NULL THEN
    RAISE EXCEPTION 'You must not send user_email field';
  ELSE
    NEW.user_email = current_setting('request.jwt.claim.email', true);<commit_msg>uuid-ossp extension is already defined and throws an error when the migration runs. it should be just a warning though so i'm commenting it out to look at later<commit_after>-- Deploy mappamundi:dev to pg

-- CREATE EXTENSION IF NOT EXISTS "uuid-ossp";



-- for these three columns we never let the caller control the contents
CREATE OR REPLACE FUNCTION mappa.override_ipsative_response_columns()
RETURNS TRIGGER AS $$
BEGIN
  IF NEW.uuid IS NOT NULL THEN
    RAISE EXCEPTION 'You must not send uuid field';
  ELSE
    NEW.uuid = mappa.uuid_generate_v4();
  END IF;
  IF NEW.created_at IS NOT NULL THEN
    RAISE EXCEPTION 'You must not send created_at field';
  ELSE
    NEW.created_at = now();
  END IF;
  IF NEW.user_email IS NOT NULL THEN
    RAISE EXCEPTION 'You must not send user_email field';
  ELSE
    NEW.user_email = current_setting('request.jwt.claim.email', true);
{'fraction_non_alphanumeric': 0.06902985074626866, 'fraction_numerical': 0.0012437810945273632, 'mean_word_length': 3.760355029585799, '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': '1197033', 'n_tokens_mistral': 533, 'n_tokens_neox': 511, 'n_words': 203}