perf: Add missing indexes to views table

This commit is contained in:
Tom Moor
2022-03-10 18:10:33 -08:00
parent f36e18e3a6
commit 503598e16d

View File

@@ -0,0 +1,17 @@
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.addIndex("views", ["userId"], {
name: "views_user_id",
});
await queryInterface.addIndex("views", ["updatedAt"], {
name: "views_updated_at",
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.removeIndex("views", "views_updated_at");
await queryInterface.removeIndex("views", "views_user_id");
}
};