Skip to content

fix(db): resolve conflicting drizzle migration entries#1482

Merged
saddlepaddle merged 1 commit into
mainfrom
neon-fix
Feb 14, 2026
Merged

fix(db): resolve conflicting drizzle migration entries#1482
saddlepaddle merged 1 commit into
mainfrom
neon-fix

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 14, 2026

Summary

  • Two PRs both generated migration 0018, causing a conflict in production (0018_sandbox_start and 0018_add_users_slack_users)
  • Consolidates both into a single clean 0018_sandbox_and_slack_users.sql migration
  • Removes orphan 0015_slack_integration.sql not referenced by the journal
  • Cleans up journal and snapshots to have 19 entries (idx 0–18)

What's left

After merge, production's __drizzle_migrations table needs to be patched to replace the two bad records with a single entry matching the new combined migration. Will handle in a follow-up.

Test plan

  • CI preview deploys successfully with the new Neon branch
  • bun drizzle-kit generate with no schema changes produces no new migration

Summary by CodeRabbit

  • Chores
    • Reorganized database migration files for Slack integration infrastructure
    • Consolidated migration entries to streamline schema management
    • Updated database snapshots and journal structure

Two PRs both generated migration 0018, causing a conflict in production.
Consolidates both into a single clean 0018_sandbox_and_slack_users migration
and removes the orphan 0015_slack_integration.sql file.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

The pull request consolidates database migrations for Slack integration. It removes an enum addition (0015), reorganizes migrations to merge 0018 and 0019 into a single migration that creates a users__slack_users table with Slack-to-user mappings and cascading foreign keys, and updates migration metadata snapshots and journal history accordingly.

Changes

Cohort / File(s) Summary
Slack Integration Enum
packages/db/drizzle/0015_slack_integration.sql
Removed the migration statement that added the 'slack' enum value to the integration_provider type.
Slack Users Schema
packages/db/drizzle/0018_sandbox_and_slack_users.sql
Added users__slack_users table with columns for Slack user ID, team ID, and references to user and organization. Includes unique constraint on (slack_user_id, team_id), two foreign keys with CASCADE delete, and two indexes on user_id and organization_id. Also drops the repositories table.
Migration Consolidation
packages/db/drizzle/0019_add_users_slack_connect.sql
Removed duplicate table creation and constraints that were consolidated into 0018.
Migration Metadata
packages/db/drizzle/meta/0018_snapshot.json, packages/db/drizzle/meta/_journal.json
Updated snapshot to reflect the new users__slack_users table structure and foreign key relationships. Consolidated journal entries by merging migrations 18 and 19 into a single entry with updated timestamp.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #1476: Directly related as it modifies the same journal entries that are being consolidated in this PR.
  • #1418: Shares the same Slack integration schema changes, specifically the users__slack_users table structure and relationships.

Poem

🐰 A Slack connection hops into place,
Users now linked in the database space,
Migrations consolidated, histories aligned,
Foreign keys cascade in perfect design,
Slack integration complete—the schema's refined! 📊

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (10 files):

⚔️ .mcp.json (content)
⚔️ apps/desktop/package.json (content)
⚔️ apps/desktop/scripts/patch-dev-protocol.ts (content)
⚔️ apps/desktop/src/lib/electron-app/factories/app/setup.ts (content)
⚔️ apps/desktop/src/main/index.ts (content)
⚔️ apps/desktop/src/main/windows/main.ts (content)
⚔️ apps/desktop/src/shared/env.shared.ts (content)
⚔️ bun.lock (content)
⚔️ packages/db/drizzle/meta/0018_snapshot.json (content)
⚔️ packages/db/drizzle/meta/_journal.json (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: resolving conflicting drizzle migration entries caused by two PRs generating the same migration number.
Description check ✅ Passed The description covers the core issue (conflicting migrations), consolidation approach, and cleanup steps. However, it lacks coverage of all template sections like Related Issues, Type of Change, and proper Testing checkbox format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch neon-fix
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch neon-fix
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 14, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app
  • ✅ Streams Fly.io app

Thank you for your contribution! 🎉

@saddlepaddle saddlepaddle merged commit 09bd627 into main Feb 14, 2026
15 checks passed
@saddlepaddle
Copy link
Copy Markdown
Collaborator Author

Production DB patched — retrigger CI by pushing an empty commit or closing/reopening the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant