Sha256: 3072f16e429a235987ea885187159bc41515765dd407a212848c70a2f266f90f

Contents?: true

Size: 516 Bytes

Versions: 33

Compression:

Stored size: 516 Bytes

Contents

START TRANSACTION;

  -- Convert a jsonb array or jsonb value to a jsonb array 
  CREATE or replace FUNCTION "fn_contentful_jsonb_any_to_jsonb_array"(potential_arr jsonb) RETURNS jsonb AS $$
  DECLARE
    result jsonb;
  BEGIN
    SELECT
      CASE 
        WHEN jsonb_typeof(potential_arr) = 'array' THEN potential_arr
        ELSE jsonb_build_array(potential_arr)
      END
      INTO result;
    RETURN result;
  END;
  $$ LANGUAGE 'plpgsql';


  INSERT INTO wcc_contentful_schema_version
    VALUES (2);
COMMIT;

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
wcc-contentful-1.7.2 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.7.1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.7.0 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.6.2 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.6.1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.6.0 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.5.1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.5.0 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.5.0.rc1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.4.0 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.4.0.rc3 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.4.0.rc2 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.3.2 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.4.0.rc1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.3.1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.3.0 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.2.1 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.2.0 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.1.2 lib/wcc/contentful/store/postgres_store/schema_2.sql
wcc-contentful-1.1.1 lib/wcc/contentful/store/postgres_store/schema_2.sql