Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated alter migrations in Postgres for String[] @default([]) @db.VarChar(64) #24138

Open
betimer opened this issue May 9, 2024 · 0 comments
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines Issue for tech Engines. topic: default topic: endless migrations topic: migrate topic: scalar list []

Comments

@betimer
Copy link

betimer commented May 9, 2024

Bug description

in schema.prisma

model page {
  collections           String[]  @default([]) @db.VarChar(64)
}

Everytime create migration will create below

-- AlterTable
ALTER TABLE "page" ALTER COLUMN "collections" SET DEFAULT ARRAY[]::VARCHAR(64)[];

How to reproduce

Expected behavior

No response

Prisma information

model page {
  collections           String[]  @default([]) @db.VarChar(64)
}
// Add your code using Prisma Client

Environment & setup

  • OS: Windows 11
  • Database: PostgreSQL 15.6
  • Node.js version: v20.12.2

Prisma Version

5.13.0
@betimer betimer added the kind/bug A reported bug. label May 9, 2024
@betimer betimer changed the title Keep generating the SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL Keep generating the SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL default array May 9, 2024
@betimer betimer changed the title Keep generating the SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL default array Keep generating the SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL default string array May 9, 2024
@janpio janpio changed the title Keep generating the SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL default string array Every migrations keeps generating SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL default string array May 10, 2024
@jkomyno jkomyno added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: migrate topic: endless migrations labels May 13, 2024
@jkomyno jkomyno changed the title Every migrations keeps generating SET DEFAULT ARRAY[]::VARCHAR(64)[]; for postgreSQL migration SQL default string array Repeated alter migrations in Postgres for String[] @default([]) @db.VarChar(64) May 13, 2024
@jkomyno jkomyno added team/schema Issue for team Schema. tech/engines Issue for tech Engines. labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines Issue for tech Engines. topic: default topic: endless migrations topic: migrate topic: scalar list []
Projects
None yet
Development

No branches or pull requests

3 participants