prisma / migrate

Issues for Prisma Migrate are now tracked at prisma/prisma. This repo was used to track issues for Prisma Migrate Experimental and is now deprecated.
https://www.prisma.io/docs/concepts/components/prisma-migrate
Apache License 2.0
766 stars 22 forks source link

Migrating from Decimal to Decimal[] breaks #617

Closed timsuchanek closed 3 years ago

timsuchanek commented 4 years ago

I have this schema in Postgres:

model B {
  id       String    @id @default(cuid())
  float    Float     @db.Real
  dFloat   Float     @db.DoublePrecision
  decFloat Decimal @db.Decimal(20, 10)
  numFloat Decimal @db.Numeric(10, 6)
}

and I want to change it to this:

model B {
  id       String    @id @default(cuid())
  float    Float     @db.Real
  dFloat   Float     @db.DoublePrecision
  decFloat Decimal[] @db.Decimal(20, 10)
  numFloat Decimal[] @db.Numeric(10, 6)
}

image

It errors like so:

Error: Error querying the database: Null constraint failed: (float)
   0: sql_migration_connector::sql_database_step_applier::apply_step
           with index=0
             at migration-engine/connectors/sql-migration-connector/src/sql_database_step_applier.rs:15
   1: migration_core::api::SchemaPush
             at migration-engine/core/src/api.rs:188
tomhoule commented 4 years ago

There are two issues with this schema:

tomhoule commented 3 years ago

Closing this as there is no other actionable item than "implement native types" — it is work in progress.