Explorar el Código

Merge pull request #23 from sharelatex/add-mysql-indexes

add indexes to mysql db
Brian Gough hace 11 años
padre
commit
3dec42be2a
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      services/clsi/app/coffee/db.coffee

+ 10 - 1
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()