Stu Mason
Stu Mason

Activity

Pull Request Opened

PR #33 opened: fix: create materialized view with NO DATA to prevent deploy timeout

Problem

The cross_platform_matches materialized view uses a pg_trgm similarity cross-join across ~75k rows from the last 48 hours. This takes 10+ minutes to compute, but Coolify's healthcheck window is ~55 seconds (5s interval, 10 retries, 5s start period). The container gets marked unhealthy and blue/green rolls back before the migration finishes.

Fix

Create the view with WITH NO DATA instead of WITH DATA. The app:refresh-cross-platform-matches scheduled command already runs every 10 minutes and will populate it.

Context

This was the second half of the deploy failure (after PR #32 fixed the ALTER DATABASE CURRENT syntax). The first fix got the SQL right, this one ensures the migration completes within the healthcheck window.

Production is already running with the view created empty — this PR just ensures future deploys (or fresh environments) won't hit the same timeout.

+7
additions
-1
deletions
1
files changed