Standard upgrade
bash
cd answerix/laravel
git pull
composer install --no-dev
npm ci && npm run build
php artisan migrate --force
php artisan config:cache && php artisan route:cache
php artisan queue:restart
That's it for most releases. Behind the scenes:
composer install/npm cisync dependencies to the release's lockfilesphp artisan migrateapplies only the new migrations — Laravel's migration table makes re-running idempotentphp artisan queue:restartsignals workers to reload the new code after finishing their current job (supervisor restarts them)
Always run migrations before restarting workers — new code may expect new tables/columns.
Major version upgrades
When jumping a major version, check the release notes for breaking changes. Common scenarios:
- Renamed env variables — diff your
.envagainst the new.env.example - A migration that requires manual data backfill — release notes will spell it out
- Removed deprecated endpoints — your custom integrations might need updates
Rollback
If an upgrade breaks something:
bash
cd answerix/laravel
git checkout <previous-tag>
composer install --no-dev
npm ci && npm run build
php artisan config:cache && php artisan route:cache
php artisan queue:restart
Database migrations are not automatically reversed. If a new migration introduced a breaking schema change, restore from the PostgreSQL backup taken before the upgrade.
Tip
Always take a database backup before upgrading in production: pg_dump -Fc answerix > pre-upgrade.dump. Managed PostgreSQL providers (DigitalOcean, RDS, …) offer point-in-time recovery — verify it's enabled.