Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds a PostgreSQL-only Laravel migration converting many JSON columns to JSONB (with per-column nullability and reversible down()), and updates installation docs to require PostgreSQL 9.4+. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Out-of-scope changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/core/installation.md (1)
12-12: Clarify that JSONB is required to avoid ambiguity.Explicitly calling out JSONB will help users understand why 9.4+ is needed.
- - MySQL 8.0+ / PostgreSQL 9.4+ + - MySQL 8.0+ / PostgreSQL 9.4+ (JSONB required)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/core/installation.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/core/installation.md
[grammar] ~12-~12: There might be a mistake here.
Context: ...el 11, 12 - MySQL 8.0+ / PostgreSQL 9.4+ - exif PHP extension (on most systems it w...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: core - PHP 8.4 - L12.* ↑
- GitHub Check: stripe - PHP 8.4 - L11.* ↑ E
- GitHub Check: admin - PHP 8.4 - L11.* ↑ E
- GitHub Check: core - PHP 8.4 - L11.* ↑ E
- GitHub Check: admin - PHP 8.4 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L12.* ↑
- GitHub Check: core - PHP 8.3 - L12.* ↑ E
- GitHub Check: core - PHP 8.3 - L11.* ↑ E
- GitHub Check: admin - PHP 8.3 - L11.* ↑ E
- GitHub Check: admin - PHP 8.3 - L11.* ↑
- GitHub Check: core - PHP 8.3 - L11.* ↑
- GitHub Check: fix-code-style
🔇 Additional comments (1)
docs/core/installation.md (1)
12-12: PostgreSQL 9.4+ aligns with the JSONB migration—good update.JSONB was introduced in PostgreSQL 9.4, so bumping the minimum version to 9.4+ is necessary for the new migration that converts JSON to JSONB.
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php
Outdated
Show resolved
Hide resolved
Co-authored-by: wychoong <[email protected]>
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php
Outdated
Show resolved
Hide resolved
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php (1)
108-108: Replace jsonb() with json() or add driver-specific guards.The migration uses Laravel's
jsonb()method which is PostgreSQL-specific and will fail on MySQL. While the current early return prevents execution on non-PostgreSQL drivers, this creates an inconsistency where the up() and down() methods use different column types (jsonbvsjson).For consistency and to avoid potential future issues, consider using
json()in both methods or adding explicit driver checks around thejsonb()calls:-$columnBuilder = $tableBlueprint->jsonb($column['name']); +$columnBuilder = $tableBlueprint->json($column['name']);Also applies to: 137-137
🧹 Nitpick comments (1)
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php (1)
163-164: Remove unnecessary blank line.There's an extra blank line before the return statement.
- return $this->prefix.$table;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php (1)
packages/core/src/Base/Migration.php (1)
Migration(7-38)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: search - PHP 8.4 - L11.* ↑ E
- GitHub Check: stripe - PHP 8.4 - L12.* ↑ E
- GitHub Check: stripe - PHP 8.4 - L11.* ↑
- GitHub Check: admin - PHP 8.4 - L12.* ↑
- GitHub Check: core - PHP 8.4 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L11.* ↑
- GitHub Check: stripe - PHP 8.3 - L12.* ↑
- GitHub Check: core - PHP 8.4 - L11.* ↑
- GitHub Check: core - PHP 8.4 - L12.* ↑ E
- GitHub Check: stripe - PHP 8.3 - L12.* ↑ E
- GitHub Check: core - PHP 8.3 - L12.* ↑
- GitHub Check: admin - PHP 8.3 - L12.* ↑
- GitHub Check: admin - PHP 8.3 - L12.* ↑ E
- GitHub Check: admin - PHP 8.3 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L11.* ↑ E
- GitHub Check: core - PHP 8.3 - L12.* ↑ E
- GitHub Check: core - PHP 8.3 - L11.* ↑
- GitHub Check: core - PHP 8.3 - L11.* ↑ E
- GitHub Check: fix-code-style
🔇 Additional comments (4)
packages/core/database/migrations/2025_08_14_164000_switch_to_jsonb.php (4)
98-101: Guard logic correctly restricts JSONB migration to PostgreSQL only.The driver check ensures the migration only runs on PostgreSQL, maintaining compatibility with MySQL and SQLite as stated in the PR objectives.
13-91: Comprehensive column mapping covers all relevant JSON fields.The mapping correctly identifies all JSON columns that need conversion to JSONB, including the critical
attribute_datafields in collections table that were causing the PostgreSQL equality operator issue mentioned in #2261. The nullable flags are properly configured for each column.
154-165: Table name resolution correctly handles special cases.The
getTableNamemethod properly handles tables that don't use the lunar_ prefix (activity_log,media) and correctly applies the configured prefix to Lunar-specific tables.
125-149: Down migration correctly reverses the JSONB conversion.The rollback logic properly converts JSONB columns back to JSON while preserving the original nullability constraints. The PostgreSQL driver check ensures consistency with the up() method.
Closes #2261
We were using standard JSON fields and when it comes to Postgres this field type is very basic, not much more than a simple text field.
JSONB is a "proper" JSON field, is supported properly in Filament and should perform a lot better.
It's worth noting MySQL & Sqlite will continue to use the same JSON field type - so no change there.
Summary by CodeRabbit
Refactor
Chores