#!/bin/sh

mysql_params=" -B -u root -pmypassword"
prefix="test_"
db_name="dbal_test"

# Print all tables
tables=`mysql ${mysql_params} -s -e "show tables" ${db_name}`

for i in $tables; do
	# Prepend every table with the prefix
	mysql ${mysql_params} -e "ALTER TABLE \`${i}\` RENAME \`${prefix}${i}\`" ${db_name}
done
