Skip to content

Commit

Permalink
update default lookup databases
Browse files Browse the repository at this point in the history
  • Loading branch information
Stell0 committed Feb 9, 2024
1 parent c0970ec commit 2b1a83f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion freepbx/initdb.d/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,16 @@
$db->query("INSERT INTO `rest_cti_macro_permissions_permissions` (`macro_permission_id`, `permission_id`) VALUES (12,1000);");
# move video_conference from settings to nethvoice_cti
$db->query("DELETE FROM `rest_cti_macro_permissions_permissions` WHERE `macro_permission_id` = 1 AND `permission_id` = 3000");
$db->query("INSERT INTO `rest_cti_macro_permissions_permissions` (`macro_permission_id`, `permission_id`) VALUES (12,3000);");
$db->query("INSERT INTO `rest_cti_macro_permissions_permissions` (`macro_permission_id`, `permission_id`) VALUES (12,3000);");

# Fix inboundlookup and outboundlookup password field
$db->query("ALTER TABLE `asterisk`.`inboundlookup` CHANGE COLUMN `mysql_password` `mysql_password` VARCHAR(255) DEFAULT NULL");
$db->query("ALTER TABLE `asterisk`.`outboundlookup` CHANGE COLUMN `mysql_password` `mysql_password` VARCHAR(255) DEFAULT NULL");

# change default host for inboundlookup and outboundlookup from localhost to 127.0.0.1:${PHONEBOOK_DB_PORT}
$db->query("UPDATE `asterisk`.`inboundlookup` SET `mysql_host` = '127.0.0.1:{$_ENV['PHONEBOOK_DB_PORT']}' WHERE `mysql_host` = 'localhost'");
$db->query("UPDATE `asterisk`.`outoundlookup` SET `mysql_host` = '127.0.0.1:{$_ENV['PHONEBOOK_DB_PORT']}' WHERE `mysql_host` = 'localhost'");

# change default host for nethcqr from localhost to 127.0.0.1:${NETHVOICE_MARIADB_PORT}
$db->query("UPDATE `asterisk`.`nethcqr_details` SET `db_url` = '127.0.0.1:{$_ENV['NETHVOICE_MARIADB_PORT']}' WHERE `db_url` = 'localhost'");
$db->query("UPDATE `asterisk`.`nethcqr_details` SET `cc_db_url` = '127.0.0.1:{$_ENV['NETHVOICE_MARIADB_PORT']}' WHERE `cc_db_url` = 'localhost'");

0 comments on commit 2b1a83f

Please sign in to comment.