Getting error NeonDbError when pushing migration file

Hi all,

So i have a schema that defines custom type JSON objects for my NeonDB database, like so:
type Address = {
  street: string;
  city: string;
  state: string;
  zip: string;
};


And I am trying to use it like so:
export const Organizations = vendorPortalSchema.table('organizations', {
  id: serial("id").primaryKey(),
  name: text("name").unique().notNull(),
  description: text("description"),
  location: json("location").$type<Address>(),  
  logo_picture_file_id: serial("logo_picture_file_id").references(
    (): AnyPgColumn  => Files.id
  ),
});


However, I am getting an error NeonDbError: data type json has no default operator class for access method "btree"

So perhaps I am not specifying the custom type of json correctly, but I could not find any examples on the drizzle website.

I also tried like (commads instead of semi-colons):
type Address = {
  street: string,
  city: string,
  state: string,
  zip: string,
};


But it still lead to the same error.

Any thoughts on how to do this properly?

Thank you!
Was this page helpful?