From fe29811004ea61b0b95e3a7b3bcbe1cbbb8bb15e Mon Sep 17 00:00:00 2001 From: Sipwise Jenkins Builder Date: Tue, 18 Jul 2023 10:06:38 +0200 Subject: [PATCH] MT#53849 peer/reseller invoicing, schemes update Change-Id: I5302491dfe2cc9fc4c426a148a99bda5d5f82e5a --- schema/billing.json | 18 +++++++++++++++--- schema/billing.sql | 3 ++- schema/kamailio.sql | 2 +- schema/ngcp.sql | 3 ++- schema/provisioning.sql | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/schema/billing.json b/schema/billing.json index eb3027bb..6c05efd2 100644 --- a/schema/billing.json +++ b/schema/billing.json @@ -3612,6 +3612,18 @@ "TABLE_NAME" : "invoice_templates", "key_col" : "invoice_templates/call_direction" }, + "invoice_templates/category" : { + "CHARACTER_SET_NAME" : "utf8mb3", + "COLLATION_NAME" : "utf8mb3_general_ci", + "COLUMN_DEFAULT" : "'customer'", + "COLUMN_NAME" : "category", + "COLUMN_TYPE" : "enum('customer','peer','reseller','did')", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 7, + "TABLE_NAME" : "invoice_templates", + "key_col" : "invoice_templates/category" + }, "invoice_templates/data" : { "CHARACTER_SET_NAME" : null, "COLLATION_NAME" : null, @@ -3651,11 +3663,11 @@ "invoice_templates/reseller_id" : { "CHARACTER_SET_NAME" : null, "COLLATION_NAME" : null, - "COLUMN_DEFAULT" : null, + "COLUMN_DEFAULT" : "NULL", "COLUMN_NAME" : "reseller_id", "COLUMN_TYPE" : "int(11) unsigned", "EXTRA" : "", - "IS_NULLABLE" : "NO", + "IS_NULLABLE" : "YES", "ORDINAL_POSITION" : 2, "TABLE_NAME" : "invoice_templates", "key_col" : "invoice_templates/reseller_id" @@ -9414,7 +9426,7 @@ "INDEX_NAME" : "invoice_templates_ibfk_1", "INDEX_TYPE" : "BTREE", "NON_UNIQUE" : 1, - "NULLABLE" : "", + "NULLABLE" : "YES", "SEQ_IN_INDEX" : 1, "SUB_PART" : null, "TABLE_NAME" : "invoice_templates", diff --git a/schema/billing.sql b/schema/billing.sql index abdb53be..19f86ffb 100644 --- a/schema/billing.sql +++ b/schema/billing.sql @@ -617,11 +617,12 @@ CREATE TABLE `email_templates` ( /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoice_templates` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `reseller_id` int(11) unsigned NOT NULL, + `reseller_id` int(11) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL DEFAULT '', `type` enum('svg','html') NOT NULL DEFAULT 'svg', `data` mediumblob DEFAULT NULL, `call_direction` enum('in','out','in_out') NOT NULL DEFAULT 'out', + `category` enum('customer','peer','reseller','did') NOT NULL DEFAULT 'customer', PRIMARY KEY (`id`), KEY `invoice_templates_ibfk_1` (`reseller_id`), CONSTRAINT `invoice_templates_ibfk_1` FOREIGN KEY (`reseller_id`) REFERENCES `resellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/schema/kamailio.sql b/schema/kamailio.sql index 47b14a9e..f08894fa 100644 --- a/schema/kamailio.sql +++ b/schema/kamailio.sql @@ -1069,7 +1069,7 @@ INSERT INTO `dom_preferences` VALUES (27,'','0','voip.sipwise.local','play_annou INSERT INTO `dom_preferences` VALUES (28,'','0','voip.sipwise.local','mobile_push_enable',0,'never',NOW()); INSERT INTO `dom_preferences` VALUES (29,'','0','voip.sipwise.local','busy_hg_member_mode',0,'ring',NOW()); INSERT INTO `domain` VALUES (1,'voip.sipwise.local',NOW(),NULL); -INSERT INTO `subscriber` VALUES (1,'no_such_number','voip.sipwise.local','0676c2e016a3b2215c045ae25f81df38','f34bbbf613348b274fd24d8836653356','1c9d1bd99fdba88235f19a8251a29552','9bcb88b6-541a-43da-8fdc-816f5557ff93','',NOW()); +INSERT INTO `subscriber` VALUES (1,'no_such_number','voip.sipwise.local','b58047db78e6b4d59a924b76a9530afe','1a91f767c036c37994a40433fd99ac70','05361e148c88ddbfab6c8a04d314ec11','9bcb88b6-541a-43da-8fdc-816f5557ff93','',NOW()); INSERT INTO `usr_preferences` VALUES (1,'9bcb88b6-541a-43da-8fdc-816f5557ff93','no_such_number','voip.sipwise.local','cloud_pbx_hunt_policy',0,'none',NOW()); INSERT INTO `usr_preferences` VALUES (5,'9bcb88b6-541a-43da-8fdc-816f5557ff93','no_such_number','voip.sipwise.local','emergency_location_format',0,'cirpack',NOW()); INSERT INTO `usr_preferences` VALUES (6,'9bcb88b6-541a-43da-8fdc-816f5557ff93','no_such_number','voip.sipwise.local','play_announce_before_recording',0,'never',NOW()); diff --git a/schema/ngcp.sql b/schema/ngcp.sql index 98c2babf..1d5b38b4 100644 --- a/schema/ngcp.sql +++ b/schema/ngcp.sql @@ -20,7 +20,7 @@ CREATE TABLE `db_schema` ( `applied_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `rev_idx` (`revision`,`node`) -) ENGINE=InnoDB AUTO_INCREMENT=844 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=845 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -30886,6 +30886,7 @@ INSERT INTO `db_schema` VALUES (840,15772,'spce',NOW()); INSERT INTO `db_schema` VALUES (841,15773,'spce',NOW()); INSERT INTO `db_schema` VALUES (842,15774,'spce',NOW()); INSERT INTO `db_schema` VALUES (843,15775,'spce',NOW()); +INSERT INTO `db_schema` VALUES (844,15776,'spce',NOW()); INSERT INTO `timezone` VALUES ('1','localtime',NOW(),NOW(),NULL); INSERT INTO `tzinfo_version` VALUES ('1','0',NOW(),NOW()); COMMIT; diff --git a/schema/provisioning.sql b/schema/provisioning.sql index ffeb5831..83758787 100644 --- a/schema/provisioning.sql +++ b/schema/provisioning.sql @@ -4405,7 +4405,7 @@ INSERT INTO `voip_sound_handles` VALUES (149,'recent_call_deleted',12,1); INSERT INTO `voip_sound_handles` VALUES (150,'ringback_tone',13,1); INSERT INTO `voip_sound_handles` VALUES (151,'aa_timeout',2,1); INSERT INTO `voip_sound_handles` VALUES (152,'aa_default',2,1); -INSERT INTO `voip_subscribers` VALUES (3,'no_such_number',2,'9bcb88b6-541a-43da-8fdc-816f5557ff93','0676c2e016a3b2215c045ae25f81df38',0,NULL,NULL,NULL,0,0,'none',NULL,'cancel',NULL,NULL,NULL,NOW(),NOW()); +INSERT INTO `voip_subscribers` VALUES (3,'no_such_number',2,'9bcb88b6-541a-43da-8fdc-816f5557ff93','b58047db78e6b4d59a924b76a9530afe',0,NULL,NULL,NULL,0,0,'none',NULL,'cancel',NULL,NULL,NULL,NOW(),NOW()); INSERT INTO `voip_usr_preferences` VALUES (1,3,97,'none',NOW()); INSERT INTO `voip_usr_preferences` VALUES (7,3,372,'cirpack',NOW()); INSERT INTO `voip_usr_preferences` VALUES (8,3,305,'never',NOW());