Add an index on the events.type column for faster SELECT DISTINCT() queries
This commit is contained in:
parent
d6b048c417
commit
863322492b
|
@ -0,0 +1,16 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const indexName ='events_type_index';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
up: (queryInterface, Sequelize) => {
|
||||||
|
return queryInterface.addIndex('events', {
|
||||||
|
name: indexName,
|
||||||
|
fields: ['type'],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
down: (queryInterface, Sequelize) => {
|
||||||
|
return queryInterface.removeIndex('events', indexName);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue