Skip to content

Commit e866a1c

Browse files
committed
add updated_at
1 parent f86a399 commit e866a1c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

shared/schema/ProjectsCounts.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ export type TProjectCount = {
66
events: number,
77
visits: number,
88
sessions: number,
9-
lastRecheck?: Date
9+
lastRecheck?: Date,
10+
updated_at: Date
1011
}
1112

1213
const ProjectCountSchema = new Schema<TProjectCount>({
1314
project_id: { type: Types.ObjectId, index: true, unique: true },
1415
events: { type: Number, required: true, default: 0 },
1516
visits: { type: Number, required: true, default: 0 },
1617
sessions: { type: Number, required: true, default: 0 },
17-
lastRecheck: { type: Date }
18-
});
18+
lastRecheck: { type: Date },
19+
updated_at: { type: Date }
20+
}, { timestamps: { updatedAt: 'updated_at' } });
1921

2022
export const ProjectCountModel = model<TProjectCount>('project_counts', ProjectCountSchema);

0 commit comments

Comments
 (0)