mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Timing_tag part of the action_plan unique constrains
This commit is contained in:
@@ -183,7 +183,7 @@ CREATE TABLE `tp_action_plans` (
|
||||
`created_at` TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `tpid` (`tpid`),
|
||||
UNIQUE KEY `unique_action_schedule` (`tpid`,`tag`,`actions_tag`)
|
||||
UNIQUE KEY `unique_action_schedule` (`tpid`,`tag`,`actions_tag`,`timing_tag`)
|
||||
);
|
||||
|
||||
--
|
||||
|
||||
@@ -22,7 +22,7 @@ mysql -u $1 -p$2 -h $host -D cgrates < "$DIR"/create_tariffplan_tables.sql
|
||||
tpt=$?
|
||||
|
||||
if [ $cu = 0 ] && [ $cdrt = 0 ] && [ $tpt = 0 ]; then
|
||||
echo -e "\n\t+++ CGR-DB successfully set-up! +++\n"
|
||||
echo "\n\t+++ CGR-DB successfully set-up! +++\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ CREATE TABLE tp_action_plans (
|
||||
timing_tag VARCHAR(64) NOT NULL,
|
||||
weight NUMERIC(8,2) NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE,
|
||||
UNIQUE (tpid, tag, actions_tag)
|
||||
UNIQUE (tpid, tag, actions_tag, timing_tag)
|
||||
);
|
||||
CREATE INDEX tpactionplans_tpid_idx ON tp_action_plans (tpid);
|
||||
CREATE INDEX tpactionplans_idx ON tp_action_plans (tpid,tag);
|
||||
|
||||
@@ -23,7 +23,7 @@ psql -U $user -h $host -d cgrates -f "$DIR"/create_tariffplan_tables.sql
|
||||
tpt=$?
|
||||
|
||||
if [ $cdrt = 0 ] && [ $tpt = 0 ]; then
|
||||
echo -e "\n\t+++ CGR-DB successfully set-up! +++\n"
|
||||
echo "\n\t+++ CGR-DB successfully set-up! +++\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user