JRoy
12/7/2018 - 2:41 AM

Git - Export database with pre-commit

#!/bin/sh
DBUSER="root"
DBPASS=""
DB="onbuy"
SCHEMAPATH="./"

if [ ! -d "$SCHEMAPATH" ]; then
 mkdir $SCHEMAPATH
fi

C:/wamp64/bin/mysql/mysql5.7.21/binmysqldump -u $DBUSER --password=$DBPASS $DB > $SCHEMAPATH/$DB.sql
git add $SCHEMAPATH/$DB.sql

echo 'Exported and added Database to commit'
exit 0