perf: Add missing indexes to views table
This commit is contained in:
17
server/migrations/20220311020825-views-indexes.js
Normal file
17
server/migrations/20220311020825-views-indexes.js
Normal 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");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user