diff --git a/data/storage/mysql/create_tariffplan_tables.sql b/data/storage/mysql/create_tariffplan_tables.sql index fb33ebbfb..8b19c1626 100644 --- a/data/storage/mysql/create_tariffplan_tables.sql +++ b/data/storage/mysql/create_tariffplan_tables.sql @@ -329,8 +329,8 @@ CREATE TABLE tp_action_profiles ( ); -DROP TABLE IF EXISTS tp_account_profiles; -CREATE TABLE tp_account_profiles ( +DROP TABLE IF EXISTS tp_accounts; +CREATE TABLE tp_accounts ( `pk` int(11) NOT NULL AUTO_INCREMENT, `tpid` varchar(64) NOT NULL, `tenant` varchar(64) NOT NULL, @@ -353,7 +353,7 @@ CREATE TABLE tp_account_profiles ( `created_at` TIMESTAMP, PRIMARY KEY (`pk`), KEY `tpid` (`tpid`), - UNIQUE KEY `unique_tp_account_profiles` (`tpid`,`tenant`, + UNIQUE KEY `unique_tp_accounts` (`tpid`,`tenant`, `id`,`filter_ids`,`balance_id` ) ); diff --git a/data/storage/postgres/create_tariffplan_tables.sql b/data/storage/postgres/create_tariffplan_tables.sql index e5d1528d0..ea53acfc3 100644 --- a/data/storage/postgres/create_tariffplan_tables.sql +++ b/data/storage/postgres/create_tariffplan_tables.sql @@ -314,8 +314,8 @@ CREATE TABLE tp_action_profiles ( "filter_ids", "action_id"); -DROP TABLE IF EXISTS tp_account_profiles; -CREATE TABLE tp_account_profiles ( +DROP TABLE IF EXISTS tp_accounts; +CREATE TABLE tp_accounts ( "pk" SERIAL PRIMARY KEY, "tpid" varchar(64) NOT NULL, "tenant" varchar(64) NOT NULL, @@ -337,8 +337,8 @@ CREATE TABLE tp_account_profiles ( "threshold_ids" varchar(64) NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE ); - CREATE INDEX tp_account_profiles_ids ON tp_account_profiles (tpid); - CREATE INDEX tp_account_profiles_unique ON tp_account_profiles ("tpid", "tenant", "id", + CREATE INDEX tp_accounts_ids ON tp_accounts (tpid); + CREATE INDEX tp_accounts_unique ON tp_accounts ("tpid", "tenant", "id", "filter_ids", "balance_id"); --