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) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-26 12:50:35 +01:00
parent 83583e0d3d
commit 3b4b51e3f2

View File

@@ -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