1. 增加自检
2. 去掉device的gin索引
This commit is contained in:
@@ -240,13 +240,13 @@ func (ps *PostgresStorage) creatingIndex() error {
|
||||
ps.logger.Info("成功为 tasks 的 parameters 字段创建 GIN 索引 (或已存在)")
|
||||
|
||||
// 为 devices 表的 properties 字段创建 GIN 索引
|
||||
ps.logger.Info("正在为 devices 表的 properties 字段创建 GIN 索引")
|
||||
ginDevicePropertiesIndexSQL := "CREATE INDEX IF NOT EXISTS idx_devices_properties_gin ON devices USING GIN (properties);"
|
||||
if err := ps.db.Exec(ginDevicePropertiesIndexSQL).Error; err != nil {
|
||||
ps.logger.Errorw("为 devices 的 properties 字段创建 GIN 索引失败", "error", err)
|
||||
return fmt.Errorf("为 devices 的 properties 字段创建 GIN 索引失败: %w", err)
|
||||
}
|
||||
ps.logger.Info("成功为 devices 的 properties 字段创建 GIN 索引 (或已存在)")
|
||||
//ps.logger.Info("正在为 devices 表的 properties 字段创建 GIN 索引")
|
||||
//ginDevicePropertiesIndexSQL := "CREATE INDEX IF NOT EXISTS idx_devices_properties_gin ON devices USING GIN (properties);"
|
||||
//if err := ps.db.Exec(ginDevicePropertiesIndexSQL).Error; err != nil {
|
||||
// ps.logger.Errorw("为 devices 的 properties 字段创建 GIN 索引失败", "error", err)
|
||||
// return fmt.Errorf("为 devices 的 properties 字段创建 GIN 索引失败: %w", err)
|
||||
//}
|
||||
//ps.logger.Info("成功为 devices 的 properties 字段创建 GIN 索引 (或已存在)")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user