File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ Example of a minimal TypeScript project with strict type-checking for attributes
8181although it is much more verbose:
8282
8383``` typescript
84- import { Model , Optional } from ' @sequelize/core' ;
84+ import { Model } from ' @sequelize/core' ;
85+ import type { PartialBy } from ' @sequelize/utils' ;
8586
8687type UserAttributes = {
8788 id: number ,
@@ -90,7 +91,7 @@ type UserAttributes = {
9091
9192// we're telling the Model that 'id' is optional
9293// when creating an instance of the model (such as using Model.create()).
93- type UserCreationAttributes = Optional <UserAttributes , ' id' >;
94+ type UserCreationAttributes = PartialBy <UserAttributes , ' id' >;
9495
9596class User extends Model <UserAttributes , UserCreationAttributes > {
9697 @Attribute (DataTypes .INTEGER )
You can’t perform that action at this time.
0 commit comments