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

Setting a default value for an array field repeats it on every subsequent migration #24086

Open
hyoretsu opened this issue May 6, 2024 · 1 comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. tech/engines/migration engine Issue in the Migration Engine topic: default topic: migrate topic: scalar list []

Comments

@hyoretsu
Copy link

hyoretsu commented May 6, 2024

Bug description

Title.

How to reproduce

Add something like the schema provided, migrate, make changes and migrate again (Or migrate and it'll think there was a change)

Expected behavior

It shouldn't repeat, as it was not changed.

Prisma information

generator kysely {
    provider            = "prisma-kysely"
    output              = "./"
    fileName            = "types.ts"
    decimalTypeOverride = "number"
}

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

model Mouse {
    id               String       @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
    polling          Int[]        @default([125]) @db.SmallInt
    createdAt        DateTime     @default(now())
    updatedAt        DateTime     @default(now())
}

Environment & setup

  • OS: Ubuntu 22.04.4 LTS
  • Database: PostgreSQL
  • Node.js version: 20.12.2

Prisma Version

prisma                  : 5.13.0
@prisma/client          : Not found
Computed binaryTarget   : debian-openssl-3.0.x
Operating System        : linux
Architecture            : x64
Node.js                 : v20.12.2
Query Engine (Node-API) : libquery-engine b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine           : schema-engine-cli b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b (at node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm             : @prisma/prisma-schema-wasm 5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b
Default Engines Hash    : b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b
Studio                  : 0.500.0
@hyoretsu hyoretsu added the kind/bug A reported bug. label May 6, 2024
@Druue Druue added topic: migrate tech/engines/migration engine Issue in the Migration Engine team/schema Issue for team Schema. team/client Issue for team Client. topic: default topic: scalar list [] bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels May 8, 2024
@Druue
Copy link
Contributor

Druue commented May 8, 2024

Hey @hyoretsu, I took a quick look and can confirm that this is happening 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. tech/engines/migration engine Issue in the Migration Engine topic: default topic: migrate topic: scalar list []
Projects
None yet
Development

No branches or pull requests

2 participants