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

Provide option to separate between relations and fields #5

Open
omar-dulaimi opened this issue Jul 20, 2022 Discussed in #3 · 2 comments
Open

Provide option to separate between relations and fields #5

omar-dulaimi opened this issue Jul 20, 2022 Discussed in #3 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@omar-dulaimi
Copy link
Owner

omar-dulaimi commented Jul 20, 2022

Discussed in #3

Originally posted by ErlanggaDewa July 13, 2022
There is an option to seperate between the relationship and the field??

I want to seperate StudentProfile relationship from the model (ApproveRequest.model.ts) to become ApproveRequest.model.ts and ApproveRequestRelationship.model.ts. Because your program still make the relationship field into one files

Example prisma schema case 👇

model ApproveRequest {
  id                String  @id @unique @default(uuid()) @map("id")
  identifyNumber    String  @map("identify_number") @db.VarChar(100)
  requestDate       String  @map("request_date") @db.VarChar(50)

  StudentProfile StudentProfile? @relation(fields: [identifyNumber], references: [identifyNumber])

}

My expected 2 files output 👇

ApproveRequest.model.ts

export class ApproveRequest {
  @IsDefined()
  @IsString()
  id!: string;

  @IsDefined()
  @IsString()
  identifyNumber!: string;

}

and

ApproveRequestRelationship.model.ts

export class ApproveRequestRelationship {
  @IsOptional()
  StudentProfile?: StudentProfile;
}

it's help me, or you can make some option like :

  1. seperate relation
  2. relation and and other field become 1 files (like your program now)
  3. not generating relation field

Originally posted by @erlanggadewa in #3 (reply in thread)

@omar-dulaimi omar-dulaimi self-assigned this Jul 20, 2022
@omar-dulaimi omar-dulaimi added the enhancement New feature or request label Jul 20, 2022
@omar-dulaimi
Copy link
Owner Author

Hello @erlanggadewa

Do you still need this?

@erlanggadewa
Copy link

@omar-dulaimi yes, i still need this. thanks for remind me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants