Unified storage SetCdr and SetRatedCdr into SetCDR, engine/storage_cdrs_it_test should automate testing for the supported StoredDb drivers

This commit is contained in:
DanB
2015-12-13 17:28:55 +01:00
parent 16beb55df8
commit eb2e8f6876
23 changed files with 324 additions and 3054 deletions

View File

@@ -0,0 +1,13 @@
{
// CGRateS Configuration file used for testing mysql implementation
"stor_db": { // database used to store offline tariff plans and CDRs
"db_type": "mysql", // stor database type to use: <mysql|postgres>
"db_host": "127.0.0.1", // the host to connect to
"db_port": 3306, // the port to reach the stordb
"db_name": "cgrates", // stor database name
"db_user": "cgrates", // username to use when connecting to stordb
"db_passwd": "CGRateS.org", // password to use when connecting to stordb
},
}

View File

@@ -0,0 +1,13 @@
{
// CGRateS Configuration file used for testing mysql implementation
"stor_db": { // database used to store offline tariff plans and CDRs
"db_type": "postgres", // stor database type to use: <mysql|postgres>
"db_host": "127.0.0.1", // the host to connect to
"db_port": 5432, // the port to reach the stordb
"db_name": "cgrates", // stor database name
"db_user": "cgrates", // username to use when connecting to stordb
"db_passwd": "CGRateS.org", // password to use when connecting to stordb
},
}

View File

@@ -1,4 +1,3 @@
--
-- Table structure for table `cdrs`
--
@@ -28,13 +27,11 @@ CREATE TABLE cdrs (
extra_fields text NOT NULL,
cost_source varchar(64) NOT NULL,
cost DECIMAL(20,4) NOT NULL,
timespans text,
cost_details text,
extra_info text,
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY cgrid (cgrid),
KEY answer_time_idx (answer_time),
KEY deleted_at_idx (deleted_at)
UNIQUE KEY cdrrun (cgrid, run_id)
);

View File

@@ -24,15 +24,15 @@ CREATE TABLE cdrs (
usage NUMERIC(30,9) NOT NULL,
supplier VARCHAR(128) NOT NULL,
disconnect_cause VARCHAR(64) NOT NULL,
extra_fields jsonb NOT NULL,
cost NUMERIC(20,4) DEFAULT NULL,
timespans jsonb,
extra_fields jsonb,
cost_source VARCHAR(64) NOT NULL,
cost NUMERIC(20,4) DEFAULT NULL,
cost_details jsonb,
extra_info text,
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
UNIQUE (cgrid)
UNIQUE (cgrid, run_id)
);
;
DROP INDEX IF EXISTS deleted_at_cp_idx;