Skip to content

Rename doesn't rename multiple models of the same relation #636

@ryands17

Description

@ryands17

Bug description

Renaming a single model doesn't rename all the instances of that model where it's present in the same relation.

How to reproduce

  1. Create a model:
model User {
  id               Int       @id @default(autoincrement())
  favoriteArticles Article[] @relation("FavoritedArticles")
  writtenArticles  Article[]
}

model Article {
  id              Int          @id @default(autoincrement())
  slug            String       @unique
  createdAt       DateTime     @default(now())
  updatedAt       DateTime     @updatedAt
  title           String
  description     String
  markdownContent String
  user            User         @relation(fields: [userId], references: [id])
  tags            ArticleTag[]
  favoritedBy     User[]       @relation("FavoritedArticles")
  userId          Int
}

model ArticleTag {
  name     String    @id
  articles Article[]
}
  1. Rename the Article model

image

  1. This is the output

image

Expected behavior

All instances of the model should be renamed.

Environment & setup

  • OS: Mac OS
  • Editor: VSCode
  • Editor version: 1.51.1
  • Extension version: 2.12.1

Metadata

Metadata

Assignees

Labels

bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions