Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Empty dbgenerated() still breaking for Unsupported() types #15654

@jaykaycodes

Description

@jaykaycodes

Bug description

Using a default(dbgenerated()) on a column with type Unsupported("...") where a Postgres generated column is manually added leads to Prisma migrate wanting to DROP DEFAULT on that column, which is an error in pg.

Empty dbgenerated() were broken for all column types in v4 and fixed recently here: #14799. Seems like the fix didn't apply to Unsupported() types.

How to reproduce

Clone & follow instructions here:
https://github.com/jkcorrea/prisma-unsupported-dbgenerated-bug

Expected behavior

To not touch the defaults for any columns with default(dbgenerated()

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model table {
  id            String                   @id
  hereBeDragons Unsupported("tsvector")? @default(dbgenerated())
}

Environment & setup

  • OS: macOS
  • Database: Postgres
  • Node.js version: v16.15.1

Prisma Version

Happens on prisma v4+ (including v4.4 and v4.5)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions