From 33dfc21e4b88f22c4a8d836fcf4b72f9960c8039 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 3041d3852b..326bfacc80 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 {