Skip to content

Commit 4860978

Browse files
authored
Fix to prod db loading script (#1721)
1 parent 6328528 commit 4860978

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/load_production_data.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ download_latest_db_dump() {
118118
echo "Restoring database from dump..."
119119
docker compose cp "$db_temp_dir/$DUMP_FILENAME" "db:/tmp/$DUMP_FILENAME"
120120
docker compose exec db bash -c "pg_restore -U $DB_USER -d $DB_NAME -v --no-owner --no-privileges /tmp/$DUMP_FILENAME" || true
121+
# apply any migrations newer than our dumped database
122+
docker compose exec web bash -c "./manage.py migrate"
121123
# update the database to delete all rows from socialaccount_social app, which need to be configured differently locally
122124
echo "Deleting all rows from socialaccount_socialapp table and setting fake passwords..."
123125
docker compose exec web bash -c "./manage.py shell -c 'from allauth.socialaccount.models import SocialApp; SocialApp.objects.all().delete()'"

0 commit comments

Comments
 (0)