mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 23:28:44 +05:00
Added migrator for *load_ids
This commit is contained in:
committed by
Dan Christian Bogos
parent
4f96ca590b
commit
8cddeca1a0
@@ -130,6 +130,7 @@ type DataDB interface {
|
||||
RemoveDispatcherProfileDrv(string, string) error
|
||||
GetItemLoadIDsDrv(itemIDPrefix string) (loadIDs map[string]int64, err error)
|
||||
SetLoadIDsDrv(loadIDs map[string]int64) error
|
||||
RemoveLoadIDsDrv() error
|
||||
GetDispatcherHostDrv(string, string) (*DispatcherHost, error)
|
||||
SetDispatcherHostDrv(*DispatcherHost) error
|
||||
RemoveDispatcherHostDrv(string, string) error
|
||||
|
||||
@@ -1049,3 +1049,7 @@ func (iDB *InternalDB) RemoveDispatcherHostDrv(tenant, id string) (err error) {
|
||||
cacheCommit(utils.NonTransactional), utils.NonTransactional)
|
||||
return
|
||||
}
|
||||
|
||||
func (iDB *InternalDB) RemoveLoadIDsDrv() (err error) {
|
||||
return utils.ErrNotImplemented
|
||||
}
|
||||
|
||||
@@ -1451,3 +1451,7 @@ func (ms *MapStorage) SetLoadIDsDrv(loadIDs map[string]int64) (err error) {
|
||||
ms.mu.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
func (ms *MapStorage) RemoveLoadIDsDrv() (err error) {
|
||||
return utils.ErrNotImplemented
|
||||
}
|
||||
|
||||
@@ -2274,3 +2274,10 @@ func (ms *MongoStorage) SetLoadIDsDrv(loadIDs map[string]int64) (err error) {
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
func (ms *MongoStorage) RemoveLoadIDsDrv() (err error) {
|
||||
return ms.query(func(sctx mongo.SessionContext) (err error) {
|
||||
_, err = ms.getCol(ColLID).DeleteMany(sctx, bson.M{})
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1675,3 +1675,7 @@ func (rs *RedisStorage) GetItemLoadIDsDrv(itemIDPrefix string) (loadIDs map[stri
|
||||
func (rs *RedisStorage) SetLoadIDsDrv(loadIDs map[string]int64) error {
|
||||
return rs.Cmd(redis_HMSET, utils.LoadIDs, loadIDs).Err
|
||||
}
|
||||
|
||||
func (rs *RedisStorage) RemoveLoadIDsDrv() (err error) {
|
||||
return rs.Cmd(redis_DEL, utils.LoadIDs).Err
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ var (
|
||||
utils.ActionPlans: "cgr-migrator -exec=*action_plans",
|
||||
utils.SharedGroups: "cgr-migrator -exec=*shared_groups",
|
||||
utils.Thresholds: "cgr-migrator -exec=*thresholds",
|
||||
utils.LoadIDsVrs: "cgr-migrator -exec=*load_ids",
|
||||
}
|
||||
storDBVers = map[string]string{
|
||||
utils.CostDetails: "cgr-migrator -exec=*cost_details",
|
||||
@@ -155,6 +156,7 @@ func CurrentDataDBVersions() Versions {
|
||||
utils.RatingProfile: 1,
|
||||
utils.Chargers: 1,
|
||||
utils.Dispatchers: 1,
|
||||
utils.LoadIDsVrs: 1,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user