Skip to content

Commit

Permalink
kamdbctl: warn that drop cmd will drop existing DB, ask for confirmat…
Browse files Browse the repository at this point in the history
…ion (GH #1858)

- warn that the drop command will drop existing DB, ask for confirmation
- manually merge pull request GH #1858 from fredposner, fred at qxork dot com
  • Loading branch information
henningw committed Feb 18, 2019
1 parent 669bb9a commit 61eb1ac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion utils/kamctl/kamctlrc
Expand Up @@ -15,7 +15,7 @@
#
# If you want to setup a database with kamdbctl, you must at least specify
# this parameter.
# DBENGINE=MYSQL
DBENGINE=MYSQL

## database host
# DBHOST=localhost
Expand Down
8 changes: 8 additions & 0 deletions utils/kamctl/kamdbctl
Expand Up @@ -375,6 +375,14 @@ case $1 in
drop)
# delete kamailio database
# create new database structures

# confirm dropping of database
echo -e "This will drop your current database.\nIt is recommended to first backup your database.\n"
get_answer ask "Continue with drop? (y/n): "
if [ "$ANSWER" != "y" ]; then
exit 1
fi

shift
if [ $# -eq 1 ] ; then
DBNAME="$1"
Expand Down
22 changes: 11 additions & 11 deletions utils/kamctl/xhttp_pi/pi_framework.xml
Expand Up @@ -219,6 +219,17 @@
<column><field>attrs</field><type>DB1_STR</type></column>
<column><field>description</field><type>DB1_STR</type></column>
</db_table>
<!-- Declaration of domainpolicy table-->
<db_table id="domainpolicy">
<table_name>domainpolicy</table_name>
<db_url_id>mysql</db_url_id>
<column><field>id</field><type>DB1_INT</type></column>
<column><field>rule</field><type>DB1_STR</type></column>
<column><field>type</field><type>DB1_STR</type></column>
<column><field>att</field><type>DB1_STR</type></column>
<column><field>val</field><type>DB1_STR</type></column>
<column><field>description</field><type>DB1_STR</type></column>
</db_table>
<!-- Declaration of domain table-->
<db_table id="domain">
<table_name>domain</table_name>
Expand All @@ -239,17 +250,6 @@
<column><field>value</field><type>DB1_STR</type></column>
<column><field>last_modified</field><type>DB1_DATETIME</type></column>
</db_table>
<!-- Declaration of domainpolicy table-->
<db_table id="domainpolicy">
<table_name>domainpolicy</table_name>
<db_url_id>mysql</db_url_id>
<column><field>id</field><type>DB1_INT</type></column>
<column><field>rule</field><type>DB1_STR</type></column>
<column><field>type</field><type>DB1_STR</type></column>
<column><field>att</field><type>DB1_STR</type></column>
<column><field>val</field><type>DB1_STR</type></column>
<column><field>description</field><type>DB1_STR</type></column>
</db_table>
<!-- Declaration of dr_gateways table-->
<db_table id="dr_gateways">
<table_name>dr_gateways</table_name>
Expand Down

0 comments on commit 61eb1ac

Please sign in to comment.