Skip to content

Commit

Permalink
Added upgrading of the DB after import to the seed script.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Dec 2, 2024
1 parent 025202c commit b200ae6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions seed-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit b200ae6

Please sign in to comment.