mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Adding TBLSMCosts model
This commit is contained in:
@@ -35,3 +35,17 @@ CREATE TABLE cdrs (
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY cdrrun (cgrid, run_id)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS sm_costs;
|
||||
CREATE TABLE sm_costs (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
cgrid char(40) NOT NULL,
|
||||
run_id varchar(64) NOT NULL,
|
||||
cost_source varchar(64) NOT NULL,
|
||||
cost_details text,
|
||||
created_at TIMESTAMP,
|
||||
deleted_at TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY costid (cgrid,run_id),
|
||||
KEY deleted_at_idx (deleted_at)
|
||||
);
|
||||
|
||||
@@ -37,3 +37,18 @@ CREATE TABLE cdrs (
|
||||
;
|
||||
DROP INDEX IF EXISTS deleted_at_cp_idx;
|
||||
CREATE INDEX deleted_at_cp_idx ON cdrs_primary (deleted_at);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS sm_costs;
|
||||
CREATE TABLE sm_costs (
|
||||
id SERIAL PRIMARY KEY,
|
||||
cgrid CHAR(40) NOT NULL,
|
||||
run_id VARCHAR(64) NOT NULL,
|
||||
cost_source VARCHAR(64) NOT NULL,
|
||||
cost_details jsonb,
|
||||
created_at TIMESTAMP,
|
||||
deleted_at TIMESTAMP,
|
||||
UNIQUE (cgrid, run_id)
|
||||
);
|
||||
DROP INDEX IF EXISTS deleted_at_smcost_idx;
|
||||
CREATE INDEX deleted_at_smcost_idx ON sm_costs (deleted_at);
|
||||
|
||||
@@ -426,3 +426,13 @@ type TBLCDRs struct {
|
||||
func (t TBLCDRs) TableName() string {
|
||||
return utils.TBL_CDRS
|
||||
}
|
||||
|
||||
type TBLSMCosts struct {
|
||||
ID int64
|
||||
Cgrid string
|
||||
RunID string
|
||||
CostSource string
|
||||
CostDetails string
|
||||
CreatedAt time.Time
|
||||
DeletedAt time.Time
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user