Conversation
WalkthroughAdds four new text column types and wiring across migration layers. Column.php adds constants TYPE_TEXT, TYPE_VARCHAR, TYPE_MEDIUMTEXT, and TYPE_LONGTEXT. New column classes Varchar, RegularText, MediumText, and LongText (constructors, fromArray factories, and getters) are added under Migration/Resources/Database/Columns. Migration source Appwrite now instantiates Varchar/TEXT/MEDIUMTEXT/LONGTEXT columns; migration destination Appwrite maps those types to corresponding UtopiaDatabase VAR_VARCHAR, VAR_TEXT, VAR_MEDIUMTEXT, and VAR_LONGTEXT. Small whitespace-only test changes are included. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@src/Migration/Destinations/Appwrite.php`:
- Around line 473-475: The mapping arms for Column::TYPE_TEXT, TYPE_MEDIUMTEXT
and TYPE_LONGTEXT are correct, but fix the source column classes and the
Appwrite case so those arms are reachable: update Text.php so its getType()
returns Column::TYPE_TEXT (not TYPE_STRING), update MediumText::getType() to
return Column::TYPE_MEDIUMTEXT, update LongText::getType() to return
Column::TYPE_LONGTEXT, and in src/Migration/Destinations/Appwrite.php ensure the
TYPE_LONGTEXT case instantiates LongText (not MediumText); leave the
VAR_TEXT/VAR_MEDIUMTEXT/VAR_LONGTEXT destination constants as-is.
In `@src/Migration/Resources/Database/Columns/LongText.php`:
- Around line 9-97: The Column::TYPE_LONGTEXT branch in the Appwrite source
currently instantiates MediumText, leaving LongText unused; update the
switch/case (the Column::TYPE_LONGTEXT handling in
src/Migration/Sources/Appwrite.php) to instantiate LongText instead of
MediumText, passing the same constructor arguments used for MediumText so
signatures match, and add or adjust any use/import for the LongText class if
missing; this will ensure LongText is actually created when getType() returns
Column::TYPE_LONGTEXT.
In `@src/Migration/Resources/Database/Columns/MediumText.php`:
- Around line 83-86: The getType() implementation in the MediumText class
currently returns Column::TYPE_STRING causing MediumText columns to be treated
as plain strings; update MediumText::getType() to return Column::TYPE_MEDIUMTEXT
so the Column::TYPE_MEDIUMTEXT → VAR_MEDIUMTEXT mapping in
Destinations/Appwrite.php is hit and the correct destination type is used.
In `@src/Migration/Sources/Appwrite.php`:
- Around line 1122-1133: The CASE for Column::TYPE_LONGTEXT incorrectly
instantiates MediumText (losing the LONGTEXT identity); replace the MediumText
instantiation with LongText and add the missing import for
Utopia\Migration\Resources\Database\Columns\LongText at the top of the file so
the TYPE_LONGTEXT branch constructs a LongText object (preserving required,
default, array, size, createdAt, updatedAt parameters) instead of MediumText.
Summary by CodeRabbit
New Features
Refactor
Tests / Style