fix(#34): rename campaign_snapshots.campaign_p_id to campaign_pid#35
Merged
Jing-yilin merged 1 commit intodevelopfrom Feb 27, 2026
Merged
fix(#34): rename campaign_snapshots.campaign_p_id to campaign_pid#35Jing-yilin merged 1 commit intodevelopfrom
Jing-yilin merged 1 commit intodevelopfrom
Conversation
The CampaignSnapshot model field `CampaignPID` was missing the `gorm:"column:campaign_pid"` tag, causing GORM to snake_case it as `campaign_p_id` instead of the expected `campaign_pid`. This caused all snapshot inserts to fail with: ERROR: column "campaign_pid" does not exist (SQLSTATE 42703) Changes: 1. Added `column:campaign_pid` GORM tag to model 2. Added idempotent migration to rename existing column Same root cause as campaigns.pid issue (#24). Fixes #34 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
campaign_snapshotstable had a column name mismatch causing 5,614 snapshot insert failures on each crawl:Root cause:
CampaignSnapshot.CampaignPIDfield was missinggorm:"column:campaign_pid"tag, causing GORM to snake_case it ascampaign_p_id(same issue as #24 for campaigns table).Solution
column:campaign_pidto GORM tag in modelImpact
Before:
After:
Testing
Related
🤖 Generated with Claude Code