mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 22:58:44 +05:00
Make Action Profiles storable in MySQL and Postgres
This commit is contained in:
committed by
Dan Christian Bogos
parent
89653a9c80
commit
d78f34bdc5
@@ -21,7 +21,8 @@
|
||||
},
|
||||
},
|
||||
"items": {
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"}
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
"*action_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
}
|
||||
},
|
||||
"items": {
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"}
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
"*action_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
55
data/conf/samples/apis_actions_redis/cgrates.json
Normal file
55
data/conf/samples/apis_actions_redis/cgrates.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
|
||||
"logger": {
|
||||
"level": 7
|
||||
},
|
||||
|
||||
"db": {
|
||||
"db_conns": {
|
||||
"*default": {
|
||||
"db_type": "redis",
|
||||
"db_port": 6379,
|
||||
"db_name": "10"
|
||||
},
|
||||
"StorDB": { // The id of the DB connection
|
||||
"db_type": "mysql", // db type: <internal|redis|mysql|mongo|postgres>
|
||||
"db_host": "127.0.0.1", // the host to connect to
|
||||
"db_port": 3306, // db port to reach the database
|
||||
"db_name": "cgrates", // db database name to connect to
|
||||
"db_user": "cgrates", // username to use when connecting to the database
|
||||
"db_password": "CGRateS.org" // password to use when connecting to the database
|
||||
},
|
||||
},
|
||||
"items": {
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"}
|
||||
}
|
||||
},
|
||||
|
||||
"actions": {
|
||||
"enabled": true,
|
||||
"thresholds_conns": ["*internal"],
|
||||
"stats_conns": ["*internal"],
|
||||
"accounts_conns": ["*internal"]
|
||||
},
|
||||
|
||||
"accounts": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"stats": {
|
||||
"enabled": true,
|
||||
"store_interval": "-1",
|
||||
"thresholds_conns": ["*internal"]
|
||||
},
|
||||
|
||||
"thresholds": {
|
||||
"enabled": true,
|
||||
"store_interval": "-1",
|
||||
"actions_conns": ["*internal"]
|
||||
},
|
||||
|
||||
"admins": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
},
|
||||
"items": {
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"}
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"items": {
|
||||
"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
"*accounts": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"}
|
||||
"*accounts": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -33,4 +33,15 @@ CREATE TABLE ip_allocations (
|
||||
PRIMARY KEY (`pk`),
|
||||
UNIQUE KEY unique_tenant_id (`tenant`, `id`)
|
||||
);
|
||||
CREATE UNIQUE INDEX ip_allocations_idx ON ip_allocations (`id`);
|
||||
CREATE UNIQUE INDEX ip_allocations_idx ON ip_allocations (`id`);
|
||||
|
||||
DROP TABLE IF EXISTS action_profiles;
|
||||
CREATE TABLE action_profiles (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`tenant` VARCHAR(40) NOT NULL,
|
||||
`id` VARCHAR(64) NOT NULL,
|
||||
`action_profile` JSON NOT NULL,
|
||||
PRIMARY KEY (`pk`),
|
||||
UNIQUE KEY unique_tenant_id (`tenant`, `id`)
|
||||
);
|
||||
CREATE UNIQUE INDEX action_profiles_idx ON action_profiles (`id`);
|
||||
@@ -32,3 +32,14 @@ CREATE TABLE ip_allocations (
|
||||
UNIQUE (tenant, id)
|
||||
);
|
||||
CREATE UNIQUE INDEX ip_allocations_idx ON ip_allocations ("id");
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS action_profiles;
|
||||
CREATE TABLE action_profiles (
|
||||
pk SERIAL PRIMARY KEY,
|
||||
tenant VARCHAR(40) NOT NULL,
|
||||
id VARCHAR(64) NOT NULL,
|
||||
action_profile JSONB NOT NULL,
|
||||
UNIQUE (tenant, id)
|
||||
);
|
||||
CREATE UNIQUE INDEX action_profiles_idx ON action_profiles ("id");
|
||||
|
||||
Reference in New Issue
Block a user