By default this scripts ignore lowercase model names and but converts relations, snake_case naming to PascalCase.
This edit ensures that all models are consistently named using PascalCase
Example schema:
model attachment {
id Int @id @default(autoincrement())
path String
attachment_type_id Int
attachment_type attachment_type @relation(name: "attachment_to_attachment_type", fields: [attachment_type_id], references: [id])
@@map("attachment")
}
model attachment_type {
id Int @id @default(autoincrement())
title String? @unique
attachments attachment[] @relation(name: "attachment_to_attachment_type")
}
Current conversion:
model attachment {
id Int @id @default(autoincrement())
path String
attachmentTypeId Int @map("attachment_type_id")
attachmentType AttachmentType @relation(name: "attachmentToattachment_type", fields: [attachmentTypeId], references: [id])
@@map("attachment")
}
model AttachmentType {
id Int @id @default(autoincrement())
title String? @unique
attachments attachment[] @relation(name: "attachmentToattachment_type")
@@map("attachment_type")
}
new/Proposed changes:
model Attachment {
id Int @id @default(autoincrement())
path String
attachmentTypeId Int @map("attachment_type_id")
attachmentType AttachmentType @relation(name: "attachmentToattachment_type", fields: [attachmentTypeId], references: [id])
@@map("attachment")
}
model AttachmentType {
id Int @id @default(autoincrement())
title String? @unique
attachments Attachment[] @relation(name: "attachmentToattachment_type")
@@map("attachment_type")
}
By default this scripts ignore lowercase model names and but converts
relations
,snake_case
naming toPascalCase
.This edit ensures that all models are consistently named using
PascalCase
Example schema:
Current conversion:
new/Proposed changes: