diff --git a/scripts/client-upgrade-db.sh b/scripts/client-upgrade-db.sh new file mode 100755 index 0000000..853e62c --- /dev/null +++ b/scripts/client-upgrade-db.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Usage: ./scripts/client-upgrade-db.sh +# Example: ./scripts/client-upgrade-db.sh MonarcBO localhost root derp monarc_backoffice + +MODULE=$1 +SQLHOST=$2 +SQLUSER=$3 +SQLPASS=$4 +SQLBASE=$5 + +cat </tmp/conf.tmp.php + array( + 'migrations' => 'module/$MODULE/migrations/db', + 'seeds' => 'module/$MODULE/migrations/seeds', + ), + 'environments' => array( + 'default_migration_table' => 'phinxlog', + 'default_database' => 'cli', + 'cli' => array( + 'adapter' => 'mysql', + 'host' => '$SQLHOST', + 'name' => '$SQLBASE', + 'user' => '$SQLUSER', + 'pass' => '$SQLPASS', + 'port' => 3306, + 'charset' => 'utf8', + ), + ), +); + +EOF + + +php ./vendor/robmorgan/phinx/bin/phinx migrate -c /tmp/conf.tmp.php +rm /tmp/conf.tmp.php