Skip to content

Conversation

@tianzhou
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 23, 2025 14:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive test case for foreign key (FK) constraint migration scenarios. The test verifies that the schema migration tool correctly handles adding foreign key constraints to existing tables using the safe NOT VALID + VALIDATE pattern.

  • Adds test input files (old.sql and new.sql) demonstrating schema changes from tables without FKs to tables with FKs
  • Includes expected outputs for different formats (diff.sql, plan.sql, plan.txt, plan.json)
  • Covers 8 different FK scenarios including composite keys, CASCADE operations, DEFERRABLE constraints, and self-referencing FKs

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testdata/diff/create_table/add_fk/old.sql Defines initial schema with 8 tables without foreign key constraints
testdata/diff/create_table/add_fk/new.sql Defines target schema with the same 8 tables now including 10 foreign key constraints
testdata/diff/create_table/add_fk/diff.sql Expected simple diff output showing ALTER TABLE statements to add FK constraints
testdata/diff/create_table/add_fk/plan.sql Expected migration plan using safe NOT VALID + VALIDATE pattern for adding FKs
testdata/diff/create_table/add_fk/plan.txt Human-readable migration plan summary listing all constraint additions
testdata/diff/create_table/add_fk/plan.json Structured JSON format of the migration plan with 20 migration steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou merged commit aadae1f into main Nov 23, 2025
8 checks passed
@tianzhou tianzhou deleted the consolidate_test_case branch December 5, 2025 15:44
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