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

Generated Id fields using cuid() as id not marked as Generated<string> #54

Closed
bazo opened this issue Jun 23, 2023 · 1 comment
Closed

Comments

@bazo
Copy link

bazo commented Jun 23, 2023

prisma model is

model User {
  id                  String      @id @default(cuid())
  name                String?
  createdAt           DateTime    @default(now()) @map("created_at")
  updatedAt           DateTime    @updatedAt @map("updated_at")
}

the genereted type is

export type User = {
    id: string;
    name: string | null;
    created_at: Generated<Timestamp>;
    updated_at: Timestamp;
};

but id should be

export type User = {
    id: Generated<string>;
    name: string | null;
    created_at: Generated<Timestamp>;
    updated_at: Timestamp;
};

and probably updatedAt should use Genereted too

@bazo bazo changed the title Fields using cuid() as id not marked as Generated<string> Generated Id fields using cuid() as id not marked as Generated<string> Jun 23, 2023
@bazo bazo closed this as completed Jun 24, 2023
@abiriadev
Copy link

and probably updatedAt should use Genereted too

See #59

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

No branches or pull requests

2 participants