diff --git a/data/migrations/migration.sh b/data/migrations/migration.sh index dedaf2445..183955207 100755 --- a/data/migrations/migration.sh +++ b/data/migrations/migration.sh @@ -21,6 +21,23 @@ down_mysql() { docker rm mysql } +up_mariadb() { + # Run a SQL database on port 3306 inside of Docker. + docker run --name mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mariadb + + # Sleep for 5s to get MySQL get started. + echo 'Sleeping for 10...' + sleep 10 + + # Add the database to mysql. + docker run --rm --link mariadb:mysql mariadb sh -c 'echo "create database genschema" | mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -ppassword' +} + +down_mariadb() { + docker kill mariadb + docker rm mariadb +} + up_postgres() { # Run a SQL database on port 5432 inside of Docker. docker run --name postgres -p 5432:5432 -d postgres @@ -73,6 +90,15 @@ test_migrate $MYSQL_CONFIG_OVERRIDE set -e down_mysql +# Test via MariaDB. +echo '> Starting MariaDB' +up_mariadb +echo '> Testing Migration (mariadb)' +set +e +test_migrate $MYSQL_CONFIG_OVERRIDE +set -e +down_mariadb + # Test via Postgres. echo '> Starting Postgres' up_postgres