feat: migrator support to change table column#813
feat: migrator support to change table column#813hwbrzzl merged 5 commits intogoravel:masterfrom almas-x:migrator
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #813 +/- ##
==========================================
+ Coverage 69.56% 69.63% +0.06%
==========================================
Files 215 215
Lines 18508 18577 +69
==========================================
+ Hits 12876 12936 +60
- Misses 4965 4974 +9
Partials 667 667 ☔ View full report in Codecov by Sentry. |
|
Review Ready |
hwbrzzl
left a comment
There was a problem hiding this comment.
Amazing PR 👍 please add some test cases in the schema_test.go file.
| return fmt.Sprintf("alter table %s add column %s", r.wrap.Table(blueprint.GetTableName()), r.getColumn(blueprint, command.Column)) | ||
| } | ||
|
|
||
| func (r *Sqlite) CompileChange(blueprint schema.Blueprint, command *schema.Command) []string { |
There was a problem hiding this comment.
The biggest difficulty is to implement the Change feature for Sqlite, it's also the reason that the feature isn't implemented in v1.15. Any thoughts, please?
There was a problem hiding this comment.
The limitations of SQLite make implementing the Change feature overly complex. Specifically, modifying a column requires creating a new table and migrating data, which introduces a higher risk of failure and potential data loss. Therefore, I believe it’s a prudent choice to forgo support for column modification in SQLite. After all, the use cases for SQLite are typically limited in scope, and applications using it are generally not overly complex, meaning the need for modifying columns is rarely urgent.
There was a problem hiding this comment.
Yes, there is a higher risk to change a field in Sqlite, we have to copy entire DB, change the field, then remove the old DB. @kkumar-gcc @devhaozi What do you think about not implementing the Change feature for Sqlite, please? If all agree, we cannot implement it, at least for now.
There was a problem hiding this comment.
Agree, since SQLite is not widely used in complex applications. Let's not implement it for now, but if someone requires it in the future, we can always implement it.
|
Review Ready |
|
Review Read |
* feat: migrator support to change table column * fix lint issue * improve unit test * add compile default for sql server and improve unit test * add more test case
|
Should this PR be cherry-picked into the 1.5.13 version? @hwbrzzl |
* feat: migrator support to change table column * fix lint issue * improve unit test * add compile default for sql server and improve unit test * add more test case (cherry picked from commit 458efb9)
* feat: migrator support to change table column * fix lint issue * improve unit test * add compile default for sql server and improve unit test * add more test case (cherry picked from commit 458efb9)
📑 Description
Go migrator support to change table column
Closes goravel/goravel#541
@coderabbitai summary
✅ Checks