fix: add missing velocity_24h and ple_delta_24h columns to campaigns table#33
Merged
Jing-yilin merged 1 commit intodevelopfrom Feb 27, 2026
Merged
Conversation
…table The model includes Velocity24h and PleDelta24h fields but the database was missing these columns, causing SQLSTATE 42703 errors when querying campaigns. Added idempotent migration to ensure both columns exist with proper defaults (0) when the backend starts. Related to deployment aa9ad5e - columns were added to model but not migrated to dev database. 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
After deploying the Cloudflare challenge fix (aa9ad5e), the backend is failing with:
The model has
Velocity24handPleDelta24hfields, but these columns don't exist in the dev database.Solution
Added idempotent migration in
db.goto ensure both columns exist:velocity_24h- DOUBLE PRECISION DEFAULT 0ple_delta_24h- DOUBLE PRECISION DEFAULT 0The migration runs on startup and is idempotent (safe to run multiple times).
Testing
Related
🤖 Generated with Claude Code