Skip to content

Commit 0317ff7

Browse files
authored
fix(#273): Add timestamps for all fields (#413)
1 parent a493b43 commit 0317ff7

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

src/models/cohort.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const cohortSchema = new Schema(
7575
return cohort
7676
},
7777
},
78+
timestamps: true,
7879
}
7980
)
8081

src/models/event.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ const Event = mongoose.model(
5151
}
5252
}
5353
]
54-
})
54+
}, { timestamps: true })
5555
);
5656
export { Event };

src/models/invitation.model.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,8 @@ const InvitationSchema = new Schema({
4949
invitationToken:{
5050
type: String,
5151
maxlength: 2048,
52-
},
53-
createdAt: {
54-
type: Date,
55-
default: Date.now,
56-
required: true,
57-
},
58-
})
52+
}
53+
}, { timestamps: true })
5954

6055
const Invitation = mongoose.model('Invitation', InvitationSchema)
6156
export { Invitation }

src/models/organization.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const organizationSchema = new Schema({
2525
enum: ['active', 'pending', 'rejected'],
2626
default: 'active',
2727
},
28-
})
28+
}, {timestamps: true})
2929

3030
const Organization = model('Organization', organizationSchema)
3131
export { Organization }

src/models/phase.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const phaseSchema = new Schema({
2222
ref: 'Organization',
2323
required: true,
2424
},
25-
});
25+
}, {timestamps: true});
2626

2727
const Phase = mongoose.model('Phase', phaseSchema);
2828
export default Phase;

src/models/profile.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const profileSchema = new Schema(
6565
{
6666
toJSON: { virtuals: true },
6767
toObject: { virtuals: true },
68+
timestamps: true,
6869
}
6970
)
7071

src/models/program.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const programSchema = new Schema(
4444
return program;
4545
},
4646
},
47+
timestamps: true,
4748
}
4849
);
4950

src/models/ratingSystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const systemRating = mongoose.model(
3333
ref: 'Organization',
3434
required: true,
3535
},
36-
})
36+
}, {timestamps: true})
3737
)
3838

3939
export { systemRating }

src/models/session.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const sessionSchema = new Schema({
2121
type: String,
2222
required: true,
2323
},
24-
});
24+
}, {timestamps: true});
2525

2626
const Session = mongoose.model('Session', sessionSchema);
2727

src/models/team.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const teamSchema = new Schema(
7777
return team
7878
},
7979
},
80+
timestamps: true,
8081
}
8182
)
8283

0 commit comments

Comments
 (0)