text: -- DO NOT EDIT - autogenerated by structgen
  CREATE OR REPLACE FUNCTION structgen_validate_json_string (data jsonb)
      RETURNS boolean
      AS $$
  DECLARE
      is_valid boolean := jsonb_typeof(data) = 'string';
  BEGIN
      IF NOT is_valid THEN
          RAISE WARNING '% is not a string', data;
      END IF;
      RETURN is_valid;
  END;
  $$
  LANGUAGE 'plpgsql'
  IMMUTABLE;
  
  CREATE OR REPLACE FUNCTION structgen_validate_json_array_string (data jsonb)
      RETURNS boolean
      AS $$
  BEGIN
      IF jsonb_typeof(data) = 'null' THEN
          RETURN TRUE;
      END IF;
      IF jsonb_typeof(data) != 'array' THEN
          RETURN FALSE;
      END IF;
      IF jsonb_array_length(data) = 0 THEN
          RETURN TRUE;
      END IF;
      RETURN (
          SELECT
              bool_and(structgen_validate_json_string (value))
          FROM
              jsonb_array_elements(data));
  END;
  $$
  LANGUAGE 'plpgsql'
  IMMUTABLE;
  
  CREATE OR REPLACE FUNCTION structgen_validate_json_array_array_string (data jsonb)
      RETURNS boolean
      AS $$
  BEGIN
      IF jsonb_typeof(data) = 'null' THEN
          RETURN TRUE;
      END IF;
      IF jsonb_typeof(data) != 'array' THEN
          RETURN FALSE;
      END IF;
      IF jsonb_array_length(data) = 0 THEN
          RETURN TRUE;
      END IF;
      RETURN (
          SELECT
              bool_and(structgen_validate_json_array_string (value))
          FROM
              jsonb_array_elements(data));
  END;
  $$
  LANGUAGE 'plpgsql'
  IMMUTABLE;
  
  CREATE OR REPLACE FUNCTION structgen_validate_json_array_5_array_array_string (data jsonb)
      RETURNS boolean
      AS $$
  BEGIN
      IF jsonb_typeof(data) != 'array' THEN
          RETURN FALSE;
      END IF;
      RETURN (
          SELECT
              bool_and(structgen_validate_json_array_array_string (value))
          FROM
              jsonb_array_elements(data))
          AND jsonb_array_length(data) = 5;
  END;
  $$
  LANGUAGE 'plpgsql'
  IMMUTABLE;
  
  CREATE TABLE trivial_configs (
      Id serial PRIMARY KEY,
      Questions jsonb NOT NULL CONSTRAINT Questions_structgen_validate_json_array_5_array_array_string CHECK (structgen_validate_json_array_5_array_array_string (Questions)),
      QuestionTimeout integer NOT NULL,
      ShowDecrassage boolean NOT NULL,
      Public boolean NOT NULL,
      id_teacher integer NOT NULL,
      Name varchar NOT NULL
  );
  
  ALTER TABLE trivial_configs
      ADD FOREIGN KEY (id_teacher) REFERENCES teachers;
  
  