From: Evan Prodromou Date: Mon, 22 Aug 2011 22:23:28 +0000 (-0400) Subject: remove old and dangerous rebuild scripts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f2387d9ad80948b014008834526dc42d8528fbf2;p=quix0rs-gnu-social.git remove old and dangerous rebuild scripts --- diff --git a/scripts/rebuilddb.sh b/scripts/rebuilddb.sh deleted file mode 100755 index 89bc6e252d..0000000000 --- a/scripts/rebuilddb.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -export user=$1 -export password=$2 -export DB=$3 -export SCR=$4 - -mysqldump -u $user --password=$password -c -t --hex-blob $DB > /tmp/$DB.sql -mysqladmin -u $user --password=$password -f drop $DB -mysqladmin -u $user --password=$password create $DB -mysql -u $user --password=$password $DB < $SCR -mysql -u $user --password=$password $DB < /tmp/$DB.sql - - diff --git a/scripts/rebuilddb_psql.sh b/scripts/rebuilddb_psql.sh deleted file mode 100755 index 6b15b9212f..0000000000 --- a/scripts/rebuilddb_psql.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# ******************************* WARNING ********************************* -# Do not run this script until you have read and understood the information -# below, AND backed up your database. Failure to observe these instructions -# may result in losing all the data in your database. -# -# This script is used to upgrade StatusNet's PostgreSQL database to the -# latest version. It does the following: -# -# 1. Dumps the existing data to /tmp/rebuilddb_psql.sql -# 2. Clears out the objects (tables, etc) in the database schema -# 3. Reconstructs the database schema using the latest script -# 4. Restores the data dumped in step 1 -# -# You MUST run this script as the 'postgres' user. -# You MUST be able to write to /tmp/rebuilddb_psql.sql -# You MUST specify the statusnet database user and database name on the -# command line, e.g. ./rebuilddb_psql.sh myuser mydbname -# - -user=$1 -DB=$2 - -cd `dirname $0` - -pg_dump -a -D --disable-trigger $DB > /tmp/rebuilddb_psql.sql -psql -c "drop schema public cascade; create schema public;" $DB -psql -c "grant all privileges on schema public to $user;" $DB -psql $DB < ../db/statusnet_pg.sql -psql $DB < /tmp/rebuilddb_psql.sql -for tab in `psql -c '\dts' $DB -tA | cut -d\| -f2`; do - psql -c "ALTER TABLE \"$tab\" OWNER TO $user;" $DB -done