You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, having an id PK uuid column of a table (example) makes an id creation attribute type to be optional. I still have to pass generated uuid v4 when creating though.
CREATE TABLE test (
id uuid primary key,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone,
deleted_at timestamp without time zone
);
results in id in TestOptionalAttributes.
export interface TestAttributes {
id: string;
createdAt: Date;
updatedAt?: Date;
deletedAt?: Date;
}
export type TestPk = "id";
export type TestId = Test[TestPk];
export type TestOptionalAttributes = "id" | "updatedAt" | "deletedAt";
export type TestCreationAttributes = Optional<TestAttributes, TestOptionalAttributes>;
When I'm not providing the optional id when creating the entity, I'm getting the notNull Violation: Test.id cannot be null
This has probably something to do with acd67f6 I see that any fieldObj.primaryKey field is considered as optional
The text was updated successfully, but these errors were encountered:
Hi, having an id PK uuid column of a table (example) makes an
id
creation attribute type to be optional. I still have to pass generated uuid v4 when creating though.results in
id
inTestOptionalAttributes
.When I'm not providing the optional
id
when creating the entity, I'm getting thenotNull Violation: Test.id cannot be null
This has probably something to do with acd67f6 I see that any
fieldObj.primaryKey
field is considered as optionalThe text was updated successfully, but these errors were encountered: