fix: startup

This commit is contained in:
Marian
2025-11-26 14:09:30 +00:00
parent 09dc2f1125
commit e598cc475c
+7 -4
View File
@@ -70,14 +70,17 @@ if [ -f "$APP_DIR/artisan" ]; then
mkdir -p "$APP_DIR/storage/framework/cache/data" "$APP_DIR/bootstrap/cache" mkdir -p "$APP_DIR/storage/framework/cache/data" "$APP_DIR/bootstrap/cache"
chmod -R 775 "$APP_DIR/storage" "$APP_DIR/bootstrap/cache" 2>/dev/null || true chmod -R 775 "$APP_DIR/storage" "$APP_DIR/bootstrap/cache" 2>/dev/null || true
# Run database migrations # Remove bootstrap config cache to force reload from .env
rm -f "$APP_DIR/bootstrap/cache/config.php" 2>/dev/null || true
# Run database migrations FIRST (creates cache table if using database driver)
log "Running database migrations" log "Running database migrations"
( cd "$APP_DIR" && php artisan migrate --force 2>&1 || log "migrations failed (continuing)" ) | head -10 ( cd "$APP_DIR" && php artisan migrate --force 2>&1 || log "migrations failed (continuing)" ) | head -10
# Clear caches (use file driver to avoid DB dependency during startup) # Clear caches AFTER migrations (now cache table exists)
log "Clearing Laravel caches" log "Clearing Laravel caches"
( cd "$APP_DIR" && CACHE_STORE=file php artisan config:clear 2>&1 || log "config:clear failed (continuing)" ) | head -5 ( cd "$APP_DIR" && php artisan config:clear 2>&1 || log "config:clear failed (continuing)" ) | head -5
( cd "$APP_DIR" && CACHE_STORE=file php artisan cache:clear 2>&1 || log "cache:clear failed (continuing)" ) | head -5 ( cd "$APP_DIR" && php artisan cache:clear 2>&1 || log "cache:clear failed (continuing)" ) | head -5
else else
log "No Laravel app at $APP_DIR; skipping artisan" log "No Laravel app at $APP_DIR; skipping artisan"
fi fi