From cc762e9551155ac3d5fbaa7e0e0ddcf3e8e0d300 Mon Sep 17 00:00:00 2001 From: DanB Date: Wed, 8 Jul 2015 18:50:17 +0200 Subject: [PATCH] Renaming tp_cdrstats -> tp_cdr_stats in storage models --- apier/v1/{callsetup.go => auth.go} | 0 data/storage/mysql/create_tariffplan_tables.sql | 6 +++--- data/storage/postgres/create_tariffplan_tables.sql | 6 +++--- engine/models.go | 4 ++++ utils/consts.go | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) rename apier/v1/{callsetup.go => auth.go} (100%) diff --git a/apier/v1/callsetup.go b/apier/v1/auth.go similarity index 100% rename from apier/v1/callsetup.go rename to apier/v1/auth.go diff --git a/data/storage/mysql/create_tariffplan_tables.sql b/data/storage/mysql/create_tariffplan_tables.sql index 5d515dccd..0948c1399 100644 --- a/data/storage/mysql/create_tariffplan_tables.sql +++ b/data/storage/mysql/create_tariffplan_tables.sql @@ -299,11 +299,11 @@ CREATE TABLE tp_derived_chargers ( -- --- Table structure for table `tp_cdrstats` +-- Table structure for table `tp_cdr_stats` -- -DROP TABLE IF EXISTS tp_cdrstats; -CREATE TABLE tp_cdrstats ( +DROP TABLE IF EXISTS tp_cdr_stats; +CREATE TABLE tp_cdr_stats ( `id` int(11) NOT NULL AUTO_INCREMENT, `tpid` varchar(64) NOT NULL, `tag` varchar(64) NOT NULL, diff --git a/data/storage/postgres/create_tariffplan_tables.sql b/data/storage/postgres/create_tariffplan_tables.sql index 83c8880fa..153b4358c 100644 --- a/data/storage/postgres/create_tariffplan_tables.sql +++ b/data/storage/postgres/create_tariffplan_tables.sql @@ -294,11 +294,11 @@ CREATE INDEX tpderivedchargers_idx ON tp_derived_chargers (tpid,loadid,direction -- --- Table structure for table `tp_cdrstats` +-- Table structure for table `tp_cdr_stats` -- -DROP TABLE IF EXISTS tp_cdrstats; -CREATE TABLE tp_cdrstats ( +DROP TABLE IF EXISTS tp_cdr_stats; +CREATE TABLE tp_cdr_stats ( id SERIAL PRIMARY KEY, tpid VARCHAR(64) NOT NULL, tag VARCHAR(64) NOT NULL, diff --git a/engine/models.go b/engine/models.go index 6280db899..76d514832 100644 --- a/engine/models.go +++ b/engine/models.go @@ -320,6 +320,10 @@ type TpCdrstat struct { CreatedAt time.Time } +func (t TpCdrstat) TableName() string { + return utils.TBL_TP_CDR_STATS +} + type TblCdrsPrimary struct { Id int64 Cgrid string diff --git a/utils/consts.go b/utils/consts.go index 769117e45..4e432df9d 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -51,7 +51,7 @@ const ( TBL_TP_RATING_PLANS = "tp_rating_plans" TBL_TP_RATE_PROFILES = "tp_rating_profiles" TBL_TP_SHARED_GROUPS = "tp_shared_groups" - TBL_TP_CDR_STATS = "tp_cdrstats" + TBL_TP_CDR_STATS = "tp_cdr_stats" TBL_TP_LCRS = "tp_lcr_rules" TBL_TP_ACTIONS = "tp_actions" TBL_TP_ACTION_PLANS = "tp_action_plans"