mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 17:36:22 +08:00
## 🔍 Overview
Deploys are failing on multisites where they had `LlmCreditAllocation`
with a `monthly_usage` value of zero because the migration was filtering
out those entries thus violating the `NOT NULL` constraint of the new
`daily_usage` column.
This update fixes the issue by wrapping the subquery in `COALESCE(...,
'{}'::jsonb)` to default to an empty JSON object when there are no
entries.
This will have no impact on sites that are already migrated because they
skip the migration via `column_exists?`, but it will fix sites that are
failing with the fixed SQL.
|
||
|---|---|---|
| .. | ||
| fixtures | ||
| migrate | ||
| post_migrate | ||