From b200ae6d38ab1beb5c9b4d38a2121c939900b5fa Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Mon, 2 Dec 2024 12:27:01 +1100 Subject: [PATCH] Added upgrading of the DB after import to the seed script. --- seed-db.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/seed-db.sh b/seed-db.sh index 410ea31..9e4cd26 100755 --- a/seed-db.sh +++ b/seed-db.sh @@ -143,6 +143,14 @@ task "Import database from the ${DB_FILE} file." cat "${DB_FILE}" | docker exec -i "${cid}" /usr/bin/mysql assert_db_was_imported "${cid}" +task "Upgrade database after import." +docker exec "${cid}" /usr/bin/mysql -e "FLUSH TABLES WITH READ LOCK;" +docker exec "${cid}" /usr/bin/mysql -e "UNLOCK TABLES;" +docker exec "${cid}" bash -c "mysql_upgrade --force" +docker exec "${cid}" /usr/bin/mysql -e "FLUSH TABLES WITH READ LOCK;" +assert_db_was_imported "${cid}" +pass "Upgraded database after import." + task "Update permissions on the seeded database files." docker exec "${cid}" bash -c "chown -R mysql /var/lib/db-data && /bin/fix-permissions /var/lib/db-data" || true pass "Updated permissions on the seeded database files."