From 6ebcd9e8fd6a807226725f4f530d083996f05767 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 15 May 2015 14:05:17 +0100 Subject: [PATCH] add indexes to db --- services/clsi/app/coffee/db.coffee | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/clsi/app/coffee/db.coffee b/services/clsi/app/coffee/db.coffee index 203915efa3..a72f61e8d0 100644 --- a/services/clsi/app/coffee/db.coffee +++ b/services/clsi/app/coffee/db.coffee @@ -16,11 +16,20 @@ module.exports = url: Sequelize.STRING project_id: Sequelize.STRING lastModified: Sequelize.DATE + }, { + indexes: [ + {fields: ['url', 'project_id']}, + {fields: ['project_id']} + ] }) Project: sequelize.define("Project", { - project_id: Sequelize.STRING + project_id: {type: Sequelize.STRING, primaryKey: true} lastAccessed: Sequelize.DATE + }, { + indexes: [ + {fields: ['lastAccessed']} + ] }) sync: () -> sequelize.sync()