summaryrefslogtreecommitdiffstats
path: root/contrib/secbugstats/bin/repairtables.sh
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-02-13 16:17:20 +0100
committerGitHub <noreply@github.com>2018-02-13 16:17:20 +0100
commit95e5e0588df0057fbefd3a05e6203c7f8e92ab09 (patch)
tree9e659a6608402a73ebdb49ca06c289af9c349e6e /contrib/secbugstats/bin/repairtables.sh
parent2b916fccae0df60b350369c6fc827c1c9ce1030e (diff)
downloadbugzilla-95e5e0588df0057fbefd3a05e6203c7f8e92ab09.tar.gz
bugzilla-95e5e0588df0057fbefd3a05e6203c7f8e92ab09.tar.xz
Bug 1343248 - Migrate secbugstats scripts to bmo production
Diffstat (limited to 'contrib/secbugstats/bin/repairtables.sh')
-rwxr-xr-xcontrib/secbugstats/bin/repairtables.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/secbugstats/bin/repairtables.sh b/contrib/secbugstats/bin/repairtables.sh
new file mode 100755
index 000000000..147669dda
--- /dev/null
+++ b/contrib/secbugstats/bin/repairtables.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# You can manually run this script if you start getting MySQL errors about
+# a table being corrupt. This will preserve the data in your tables.
+
+# scripts location (where does this config file live?)
+SCRIPTS_DIR="$(dirname "$(readlink /proc/$$/fd/255)")"
+source $SCRIPTS_DIR/settings.cfg
+
+echo "repair table BugHistory;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS
+echo "repair table Bugs;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS
+echo "repair table Details;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS
+echo "repair table Stats;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS