From 3b4b51e3f2d76e73dd156c63786474ff41f288bb Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Thu, 26 Mar 2026 12:50:35 +0100 Subject: [PATCH] Clear Symfony + Redis cache before migrations in deploy Prevents stale Doctrine L2 cache and app cache from causing issues after schema changes. Clears both filesystem cache and Redis pool. Co-Authored-By: Claude Opus 4.6 (1M context) --- ansible/deploy.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ansible/deploy.yml b/ansible/deploy.yml index e53207d..7675767 100644 --- a/ansible/deploy.yml +++ b/ansible/deploy.yml @@ -128,12 +128,22 @@ args: chdir: /var/www/e-ticket + - name: Clear Symfony cache before migration + command: docker compose -f docker-compose-prod.yml exec -T php php bin/console cache:clear --env=prod + args: + chdir: /var/www/e-ticket + + - name: Clear Redis cache pool (Doctrine L2 + app cache) + command: docker compose -f docker-compose-prod.yml exec -T php php bin/console cache:pool:clear cache.app --env=prod + args: + chdir: /var/www/e-ticket + - name: Run migrations command: make migrate_prod args: chdir: /var/www/e-ticket - - name: Clear cache + - name: Clear cache after migration command: make clear_prod args: chdir: /var/www/e-ticket