|
@@ -224,11 +224,15 @@ before_script:
|
|
|
- |
|
|
|
echo "Setting up database"
|
|
|
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
|
|
|
- echo "MySQL"
|
|
|
+ echo "MySQL drop database"
|
|
|
mysql -u root -e 'DROP DATABASE IF EXISTS travis;'
|
|
|
- mysql -u root -e 'CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';'
|
|
|
+ echo "MySQL create database"
|
|
|
+ mysql -u root -e "CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';"
|
|
|
+ echo "MySQL create user"
|
|
|
mysql -u root -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
|
|
|
+ echo "MySQL grant"
|
|
|
mysql -u root -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
|
|
+ echo "MySQL flush"
|
|
|
mysql -u root -e 'FLUSH PRIVILEGES;'
|
|
|
mysql -u root -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
|
|
fi
|
|
@@ -237,10 +241,10 @@ before_script:
|
|
|
sudo mkdir -p /tmp/pgloader
|
|
|
sudo chmod -R a+rwx /tmp/pgloader/
|
|
|
sudo pgloader mysql://root@127.0.0.1/travis postgresql://postgres:postgres@127.0.0.1:5432/travis
|
|
|
- echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql ''postgresql://postgres:postgres@127.0.0.1:5432/travis''
|
|
|
- echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql ''postgresql://postgres:postgres@127.0.0.1:5432/travis''
|
|
|
+ echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql 'postgresql://postgres:postgres@127.0.0.1:5432/travis'
|
|
|
+ echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql 'postgresql://postgres:postgres@127.0.0.1:5432/travis'
|
|
|
# Create pgsql compatibility functions
|
|
|
- psql 'postgresql://postgres:postgres@127.0.0.1:5432/travis'' < htdocs/install/pgsql/functions/functions.sql
|
|
|
+ psql 'postgresql://postgres:postgres@127.0.0.1:5432/travis' < htdocs/install/pgsql/functions/functions.sql
|
|
|
fi
|
|
|
echo
|
|
|
|