-
Notifications
You must be signed in to change notification settings - Fork 150
✨ add constaint diffs to BuildPage panel #1731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 390b700 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Updates to Preview Branch (feat/diff-constaint) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
CI Feedback 🧐(Feedback updated until commit 390b700)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
927620b
to
9ed3f92
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
frontend/packages/db-structure/src/diff/constraints/buildConstaintColumnNameDiffItem.ts
Outdated
Show resolved
Hide resolved
9ed3f92
to
039407f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made one comment!🙏
import { buildConstaintDeleteConstraintDiffItem } from './constraints/buildConstaintDeleteConstraintDiffItem.js' | ||
import { buildConstaintDetailDiffItem } from './constraints/buildConstaintDetailDiffItem.js' | ||
import { buildConstaintNameDiffItem } from './constraints/buildConstaintNameDiffItem.js' | ||
import { buildConstaintTargetColumnNameDiffItem } from './constraints/buildConstaintTargetColumnNameDiffItem.js' | ||
import { buildConstaintTargetTableNameDiffItem } from './constraints/buildConstaintTargetTableNameDiffItem.js' | ||
import { buildConstaintUpdateConstraintDiffItem } from './constraints/buildConstaintUpdateConstraintDiffItem.js' | ||
import { buildConstraintColumnNameDiffItem } from './constraints/buildConstraintColumnNameDiffItem.js' | ||
import { buildConstaintDiffItem } from './constraints/buildConstraintDiffItem.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name and file name may be “Constaint” instead of "Constraint"💭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My eyes skimmed over it and I easily missed the typo, so I really appreciate your pointing it out. 🙏
🐛 fix typo in buildConstraintDiffItem function and related imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I got all the file names wrong... I'll go ahead and fix them! 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I’ve finally fixed everything this time. 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! I think it is perfect!✅
Refactor GridTable components to accept a className prop, allowing for additional styling flexibility. This change improves the customization options for users of the GridTable component while maintaining existing functionality.
Upgrade zod to version 3.24.3 across multiple dependencies in pnpm-lock.yaml to ensure compatibility and leverage improvements. Additionally, add ts-pattern version 5.7.0 to the db-structure package.json, enhancing functionality and type safety in the project.
Implement new utilities for handling constraint-related schema differences, including buildConstraintDiffItem, buildConstaintNameDiffItem, buildConstaintColumnNameDiffItem, buildConstaintTargetTableNameDiffItem, buildConstaintTargetColumnNameDiffItem, buildConstaintUpdateConstraintDiffItem, buildConstaintDeleteConstraintDiffItem, and buildConstaintDetailDiffItem. Update existing types and constants to support these functionalities, ensuring comprehensive type safety and consistency in the schema diff utilities.
Implement the ConstraintList component to display various types of constraints (Primary Key, Foreign Key, Unique, Check) in the schema diff view. Introduce new ConstraintItem components for each constraint type, enhancing the organization and readability of the diff view. Update TableItem and TableDiffBlock components to support collapsible functionality for constraints, ensuring a consistent layout and improved user experience.
…aint column name diff Correct the spelling of 'CheckConstarintDetail' to 'CheckConstraintDetail' across multiple files for consistency. Introduce a new utility function, 'buildConstraintColumnNameDiffItem', to handle schema differences related to constraint column names, enhancing the overall functionality of the schema diff utilities.
Correct the spelling of 'buildConstaintDiffItem' to 'buildConstraintDiffItem' in the buildSchemaDiff.ts and buildConstraintDiffItem.ts files for consistency and accuracy. This change enhances code readability and maintains naming conventions across the schema diff utilities.
039407f
to
0d23379
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! LGTM🚀
Why is this change needed?
This PR introduces diff representation for table constraints in the schema-comparison views.
Key Points
Constraint-level diff utilities
buildPrimaryKeyDiffItem
,buildForeignKeyDiffItem
,buildUniqueConstraintDiffItem
,buildCheckConstraintDiffItem
, andbuildNotNullConstraintDiffItem
.getChangeStatus
to resolve constraint IDs and filter by(tableId, constraintId)
.Typed models & constants
ConstraintDiffItem
and related enumerations for strict type safety.What would you like reviewers to focus on?
Testing Verification
What was done
🤖 Generated by PR Agent at 9ed3f92
Detailed Changes
29 files
Add constraint-related diff item builders and integration
Add constraint path patterns for diff matching
Add builder for constraint column name diff item
Add builder for constraint delete action diff item
Add builder for check constraint detail diff item
Add builder for constraint name diff item
Add builder for constraint target column diff item
Add builder for constraint target table diff item
Add builder for constraint update action diff item
Add builder for base constraint diff item
Add constraint diff item types and enums
Extend getChangeStatus to support constraintId
Export constraint diff types from package entrypoint
Export constraint and check detail types
Add types for constraint name and check constraint detail
Add ConstraintList UI for rendering constraint diffs
Add styles for ConstraintList and sections
Add CheckConstraintItem UI for check constraints
Add ForeignConstraintItem UI for foreign key constraints
Add PrimaryConstraintItem UI for primary key constraints
Add UniqueConstraintItem UI for unique constraints
Add helper for constraint diff status styling
Add icon styles for constraint items
Export all constraint item components
Export ConstraintList component
Integrate ConstraintList into TableItem, add collapsible
Add constraint section open/close state to TableDiffBlock
Add className prop support to GridTable components
Add constraints property to table mock data
2 files
Add ts-pattern dependency, update zod version
Update lockfile for new/updated dependencies
1 files
Add changeset for constraint diff utilities/types
1 files
Additional Notes