Timing_tag part of the action_plan unique constrains

This commit is contained in:
DanB
2019-04-10 19:23:00 +02:00
parent 994a429c7b
commit 500ce4952a
4 changed files with 4 additions and 4 deletions

View File

@@ -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`)
);
--

View File

@@ -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

View File

@@ -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);

View File

@@ -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