Repository navigation
hotfix(migrations): fix 4 duplicate LLC Alembic revision IDs + FK chain (#8460 v2) - #8466
Merged
Merged
Conversation
…3_022) Four LLC migrations were merged with identical revision = "20260523_022", breaking alembic upgrade head. Creates a linear chain: 021 (heartbeat_wakeup) → 022 (create_llc_work_items) [unchanged anchor] → 023 (organization_llc_extensions) [renamed from 022, GH#8211] → 024 (llc_goals) [renamed from 022, GH#8212] → 025 (llc_agent_budgets) [renamed from 022, GH#8215] All pending LLC migration PRs must rebase and use revision 026+ with down_revision = "20260523_025". Co-Authored-By: Paperclip <noreply@paperclip.ing>
… chain Migration 022 referenced llc_goals.id via inline ForeignKey, but llc_goals is not created until migration 024. This caused alembic upgrade head to fail with "relation llc_goals does not exist" on any fresh database. Fix: remove the inline FK from 022, add op.create_foreign_key in 024.upgrade() after llc_goals exists, and op.drop_constraint in 024.downgrade() before the table is dropped. Also corrects stale docstring in 025 (still showed old Revision ID / Revises from before the rename). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
| Metric | Count |
|---|---|
| Total Violations | 7 |
| SSOT Violations (high priority) | 7 |
| Other Violations | 0 |
⚠️ 7 values have SSOT config equivalents!
These should be replaced with SSOT config imports:
Python:
from src.config.ssot_config import config
# Use: config.vm.main, config.port.backend, config.backend_urlTypeScript:
import config from '@/config/ssot-config'
// Use: config.vm.main, config.port.backend, config.backendUrl📖 See SSOT_CONFIG_GUIDE.md for documentation.
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
Three LLC migrations were merged concurrently with identical
revision = "20260523_022", breakingalembic upgrade head. A first attempt (PR #8460) was created but became conflicting when6091fb4a5(GH#8215 budget enforcement) landed onDev_new_guiwithdown_revision = "20260523_022".Fix
Establishes a correct linear chain:
Files renamed (
022_organization_llc_extensions→023_*,022_llc_goals→024_*) with matchingrevision/down_revisionupdates.The FK from
llc_work_items.goal_id → llc_goals.idcould not live in migration 022 (goals table didn't exist yet). It is deferred to024_llc_goals.pywhich runs after both tables exist — ensuringCREATE TABLEsucceeds andalembic downgradetears down in reverse order cleanly.Downgrade safety
llc_agent_budget_events,llc_budget_limitsllc_goalsorganizationsllc_work_item_comments,llc_work_itemsUnblocks
down_revision = "20260523_025"🤖 Generated with Claude Code