Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces migration support for generated columns while also adding support for the "Always" attribute in column definitions.
- Added Always() and GeneratedAs() methods (and their corresponding getters) in both production and mock implementations.
- Updated table command display logic and test cases to incorporate schema prefixes for table names.
- Updated interface definitions in the contracts package to support the new methods.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| mocks/database/driver/ColumnDefinition.go | Added mock implementations for Always, GeneratedAs, GetGeneratedAs, IsAlways, and IsSetGeneratedAs. |
| database/schema/column.go | Implemented Always and GeneratedAs methods in ColumnDefinition, and added GetGeneratedAs and IsAlways logic. |
| database/console/table_command_test.go | Updated expected output to include schema prefix for table names. |
| database/console/table_command.go | Modified display logic to prepend schema to the table name if available. |
| contracts/database/driver/column.go | Updated the ColumnDefinition interface to include new methods and refined comments. |
Comments suppressed due to low confidence (1)
database/schema/column.go:81
- Appending an empty string to the expression slice may be unnecessary and could lead to confusion when handling variadic arguments. Consider revising the logic to either accept a single expression or document the rationale for always appending an empty string.
expression = append(expression, "")
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1044 +/- ##
=======================================
Coverage 70.48% 70.48%
=======================================
Files 176 176
Lines 12339 12339
=======================================
Hits 8697 8697
Misses 3261 3261
Partials 381 381 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
I will create a new PR to add external tests after goravel/postgres is updated. |
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
hwbrzzl
approved these changes
May 23, 2025
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.
📑 Description
Closes goravel/goravel#669
✅ Checks