File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
express-main-example/src/sequelize/models Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,15 @@ interface InstrumentAttributes {
55 id : number ;
66 type : string ;
77 purchaseDate : Date ;
8+
9+ // We need to specify the 'orchestraId' field here,
10+ // because it will automatically be defined later on
11+ // when Sequelize applies the associations
812 orchestraId : number ;
913}
1014
15+ // we can omit the 'id' field, since we aren't required
16+ // to set it manually when creating a new entry
1117interface InstrumentCreationAttributes
1218 extends Omit < InstrumentAttributes , "id" > { }
1319
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ interface OrchestraAttributes {
66 name : string ;
77}
88
9+ // we can omit the 'id' field, since we aren't required
10+ // to set it manually when creating a new entry
911interface OrchestraCreationAttributes extends Omit < OrchestraAttributes , "id" > { }
1012
1113export const Orchestra : ModelDefined <
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ interface UserAttributes {
66 username : string ;
77}
88
9+ // we can omit the 'id' field, since we aren't required
10+ // to set it manually when creating a new entry
911interface UserCreationAttributes extends Omit < UserAttributes , "id" > { }
1012
1113export const User : ModelDefined <
You can’t perform that action at this time.
0 commit comments