check_database_migration_consistency.sh 362 B

12345678910111213141516
  1. #!/bin/bash
  2. set -e
  3. TMP_FILE_BEFORE='./tmp/before-migration-dump.json'
  4. TMP_FILE_AFTER='./tmp/after-migration-dump.json'
  5. echo "Checking if data is still the same after migration…"
  6. if ! cmp $TMP_FILE_BEFORE $TMP_FILE_AFTER
  7. then
  8. echo "Data mismatch after migration."
  9. diff $TMP_FILE_BEFORE $TMP_FILE_AFTER
  10. exit 1
  11. else
  12. echo "Migration was successful."
  13. fi