prisma / prisma-test-utils

A collection of data model agnostic test utils.
113 stars 11 forks source link

"Unsupported jsonb version number 111" #34

Open divyenduz opened 4 years ago

divyenduz commented 4 years ago

This is most likely an issue with test-utils producing incorrect data for jsonb type. Note that fixing this would still not work yet (https://github.com/prisma/prisma-client-js/issues/60). The error it should yield should be similar to WrongType (jsonb).

We might need a specific faker for jsonb type. However, I think that information is lost in dmmf, so let us see how we can make that possible.


Internal notes:

Test utils database(s) affected:

model eventsources {
  abi              String?
  app_name         String
  contract_address String
  created_at       DateTime?
  enabled          Boolean         @default(true)
  ens_name         String?
  event_name       String
  eventsource_id   Int             @default(autoincrement()) @id
  from_block       Int
  kernel_address   String
  last_poll        DateTime?
  network          String
  subscriptions    subscriptions[]

  @@unique([contract_address, network, event_name], name: "eventsources_contract_address_event_name_network_unique")
}
CREATE TABLE public.eventsources (
    eventsource_id integer NOT NULL,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    enabled boolean DEFAULT true NOT NULL,
    contract_address character varying(255) NOT NULL,
    kernel_address character varying(255) NOT NULL,
    ens_name character varying(255),
    abi jsonb,
    event_name character varying(255) NOT NULL,
    app_name character varying(255) NOT NULL,
    network character varying(255) NOT NULL,
    from_block bigint NOT NULL,
    last_poll timestamp with time zone
);
janpio commented 4 years ago

I added model and SQL information that shows that the jsonb column is currently introspected as String?, thus test-utils currently can not know what type of data to generate.