mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
Make RateProfiles storable in MySQL and Postgres
This commit is contained in:
committed by
Dan Christian Bogos
parent
a559563810
commit
da41db3f56
@@ -536,3 +536,27 @@ type RouteProfileMdl struct {
|
||||
func (RouteProfileMdl) TableName() string {
|
||||
return utils.TBLRouteProfiles
|
||||
}
|
||||
|
||||
// Doesnt include Rates in RateProfile json, Rates taken from Rate using foreign keys
|
||||
type RateProfileJSONMdl struct {
|
||||
PK uint `gorm:"primary_key"`
|
||||
Tenant string `index:"0" re:".*"`
|
||||
ID string `index:"1" re:".*"`
|
||||
RateProfile utils.JSONB `gorm:"type:jsonb" index:"2" re:".*"`
|
||||
}
|
||||
|
||||
func (RateProfileJSONMdl) TableName() string {
|
||||
return utils.TBLRateProfiles
|
||||
}
|
||||
|
||||
type RateMdl struct {
|
||||
PK uint `gorm:"primary_key"`
|
||||
Tenant string `index:"0" re:".*"`
|
||||
ID string `index:"1" re:".*"`
|
||||
Rate utils.JSONB `gorm:"type:jsonb" index:"2" re:".*"`
|
||||
RateProfileID string `gorm:"foreign_key" index:"3" re:".*"`
|
||||
}
|
||||
|
||||
func (RateMdl) TableName() string {
|
||||
return utils.TBLRates
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user