fix: startup
This commit is contained in:
@@ -70,14 +70,17 @@ if [ -f "$APP_DIR/artisan" ]; then
|
||||
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
|
||||
|
||||
# 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"
|
||||
( 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"
|
||||
( cd "$APP_DIR" && CACHE_STORE=file 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 config:clear 2>&1 || log "config:clear failed (continuing)" ) | head -5
|
||||
( cd "$APP_DIR" && php artisan cache:clear 2>&1 || log "cache:clear failed (continuing)" ) | head -5
|
||||
else
|
||||
log "No Laravel app at $APP_DIR; skipping artisan"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user