Skip to content

fix(migrations): remove duplicate column addition#4632

Merged
Sg312 merged 1 commit into
stagingfrom
fix/inconsistent-migration
May 16, 2026
Merged

fix(migrations): remove duplicate column addition#4632
Sg312 merged 1 commit into
stagingfrom
fix/inconsistent-migration

Conversation

@Sg312
Copy link
Copy Markdown
Collaborator

@Sg312 Sg312 commented May 16, 2026

Summary

Remove duplicate column addition in migrations

Type of Change

  • Bug fix

Testing

Manaul

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 16, 2026 5:43pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR removes a duplicate ALTER TABLE "copilot_chats" ADD COLUMN "pinned" boolean DEFAULT false NOT NULL statement from migration 0208_modern_power_man.sql. The column was already added in the immediately preceding migration 0207_colorful_secret_warriors.sql, so the duplicate would cause a runtime error (column "pinned" of relation "copilot_chats" already exists) on any environment where both migrations run in sequence.

  • Duplicate DDL removed: The pinned column addition that was mistakenly included in 0208 has been cleaned up; the canonical source remains 0207_colorful_secret_warriors.sql.
  • No schema change: The final database schema is unchanged — only the erroneous second ADD COLUMN statement is dropped.

Confidence Score: 5/5

Safe to merge — removes a duplicate DDL statement that would have caused a migration failure on any environment running both 0207 and 0208 in sequence.

The change is a single-line deletion of a duplicate ADD COLUMN statement already present in the prior migration. The column definition in 0207 is identical, so no schema intent is lost, and the rest of 0208 is untouched.

No files require special attention.

Important Files Changed

Filename Overview
packages/db/migrations/0208_modern_power_man.sql Removes duplicate ADD COLUMN statement for copilot_chats.pinned; the column is correctly defined in 0207. The remaining content (workspace_file_folders table, indexes, FK constraints) is unaffected.

Sequence Diagram

sequenceDiagram
    participant DB as Database
    participant M207 as Migration 0207
    participant M208 as Migration 0208

    M207->>DB: ALTER TABLE copilot_chats ADD COLUMN pinned boolean DEFAULT false NOT NULL
    Note over DB: Column pinned created ✓

    M208->>DB: CREATE TABLE workspace_file_folders (...)
    M208->>DB: DROP INDEX workspace_files_workspace_name_active_unique
    M208->>DB: ALTER TABLE workspace_files ADD COLUMN folder_id text
    Note over M208,DB: (duplicate ADD COLUMN pinned removed)
    M208->>DB: "ADD FK constraints & indexes for workspace_file_folders"
Loading

Reviews (1): Last reviewed commit: "Clean up migration" | Re-trigger Greptile

@Sg312 Sg312 merged commit 67e18f7 into staging May 16, 2026
13 checks passed
Sg312 added a commit that referenced this pull request May 16, 2026
fix(migrations): remove duplicate column add (fix(migrations): remove duplicate column addition #4632)
@waleedlatif1 waleedlatif1 deleted the fix/inconsistent-migration branch May 17, 2026 07:10
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