#!/bin/bash
# prepare the environment to use the local mysql database, e.g.
#  bin /with_mysql rails s
#
# rake tasks may use the following subtask:
#  rake mysql test:requests

if [ -z "$RAILS_ENV" ]
then
  env="development"
else
  env=$RAILS_ENV
fi

export RAILS_DB_ADAPTER=mysql2
export RAILS_DB_NAME=hitobito_$env
#export RAILS_DB_NAME=hitobito_production
export RAILS_DB_USERNAME=root
#export RAILS_DB_PASSWORD=root
#export RAILS_DB_SOCKET=/var/lib/mysql/mysql.sock
export RAILS_DB_SOCKET=/var/run/mysqld/mysqld.sock

$@
