aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-05-05 23:13:54 +0200
committerMario Vavti <mario@mariovavti.com>2017-05-07 15:09:53 +0200
commitb7df4de4b751203f43ccf73ca88a2ac3b6c39729 (patch)
tree3077e38fcd1aa4aa6403b753e7b22a951d3fafed /tests
parentb237425c9465dad8c0f597f3402d8119d40d1b2e (diff)
downloadvolse-hubzilla-b7df4de4b751203f43ccf73ca88a2ac3b6c39729.tar.gz
volse-hubzilla-b7df4de4b751203f43ccf73ca88a2ac3b6c39729.tar.bz2
volse-hubzilla-b7df4de4b751203f43ccf73ca88a2ac3b6c39729.zip
:construction_worker::white_check_mark::bug: Import table structure in TravisCI.
Fix a syntax error in schema_postres.sql which was discovered while working on this.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/travis/prepare_mysql.sh11
-rwxr-xr-xtests/travis/prepare_pgsql.sh13
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/travis/prepare_mysql.sh b/tests/travis/prepare_mysql.sh
index 92c720205..b3d84253c 100755
--- a/tests/travis/prepare_mysql.sh
+++ b/tests/travis/prepare_mysql.sh
@@ -36,4 +36,13 @@ mysql -e "SHOW VARIABLES LIKE 'character_set%';"
mysql -e "SELECT @@sql_mode;"
# Create Hubzilla database
-mysql -e "CREATE DATABASE IF NOT EXISTS hubzilla;" -uroot;
+mysql -u root -e "CREATE DATABASE IF NOT EXISTS hubzilla;";
+mysql -u root -e "CREATE USER 'hubzilla'@'localhost' IDENTIFIED BY 'hubzilla';"
+mysql -u root -e "GRANT ALL ON hubzilla.* TO 'hubzilla'@'localhost';"
+
+# Import table structure
+mysql -u root hubzilla < ./install/schema_mysql.sql
+
+# Show databases and tables
+mysql -u root -e "SHOW DATABASES;"
+mysql -u root -e "USE hubzilla; SHOW TABLES;"
diff --git a/tests/travis/prepare_pgsql.sh b/tests/travis/prepare_pgsql.sh
index dcd83f3be..63c7388cb 100755
--- a/tests/travis/prepare_pgsql.sh
+++ b/tests/travis/prepare_pgsql.sh
@@ -30,8 +30,15 @@ echo "Preparing for PostgreSQL ..."
# Print out some PostgreSQL information
psql --version
# Why does this hang further execution of the job?
-psql -c "SELECT VERSION();" -U postgres
+psql -U postgres -c "SELECT VERSION();"
# Create Hubzilla database
-psql -c "DROP DATABASE IF EXISTS hubzilla;" -U postgres
-psql -c "CREATE DATABASE hubzilla;" -U postgres
+psql -U postgres -c "DROP DATABASE IF EXISTS hubzilla;"
+psql -U postgres -c "CREATE DATABASE hubzilla;"
+
+# Import table structure
+psql -U postgres -v ON_ERROR_STOP=1 hubzilla < ./install/schema_postgres.sql
+
+# Show databases and tables
+psql -U postgres -l
+psql -U postgres -d hubzilla -c "\dt;"