From 66ced98bf564e73235b3f3b1e086ccba3a23ce9a Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 27 Aug 2018 04:50:52 +0900 Subject: [PATCH] Fix bug --- src/models/stats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/stats.ts b/src/models/stats.ts index 3041d3852..326bfacc8 100644 --- a/src/models/stats.ts +++ b/src/models/stats.ts @@ -2,7 +2,8 @@ import * as mongo from 'mongodb'; import db from '../db/mongodb'; const Stats = db.get('stats'); -Stats.createIndex({ date: -1 }, { unique: true }); +Stats.dropIndex({ date: -1 }); // 後方互換性のため +Stats.createIndex({ span: -1, date: -1 }, { unique: true }); export default Stats; export interface IStats {