feat: 添加数据库索引优化查询性能
refactor(前端): 使用useMemo和useCallback优化性能 perf(后端): 优化统计查询性能 style: 统一前端样式定义 build: 添加创建索引脚本
This commit is contained in:
@@ -49,7 +49,12 @@ const ConsumableRecord = sequelize.define('ConsumableRecord', {
|
||||
}
|
||||
}, {
|
||||
tableName: 'consumable_records',
|
||||
timestamps: true
|
||||
timestamps: true,
|
||||
indexes: [
|
||||
{ fields: ['consumableId'] },
|
||||
{ fields: ['type'] },
|
||||
{ fields: ['createdAt'] }
|
||||
]
|
||||
});
|
||||
|
||||
ConsumableRecord.belongsTo(Consumable, {
|
||||
|
||||
Reference in New Issue
Block a user