Skip to content

fix database type overwritten by the family type#162

Merged
abnegate merged 3 commits intomainfrom
fix-database-family-type
Mar 12, 2026
Merged

fix database type overwritten by the family type#162
abnegate merged 3 commits intomainfrom
fix-database-family-type

Conversation

@ArnabChatterjee20k
Copy link
Contributor

@ArnabChatterjee20k ArnabChatterjee20k commented Mar 11, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Exported resources now preserve the original database type in output while using a generalized family type for support checks to improve compatibility.
    • Exported databases explicitly include the original "database" value and preserve "enabled" (defaults to true if missing) to ensure completeness.
    • Table entries inherit their "enabled" state from the parent database for consistent behavior across exports.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f254dfd-b122-4a85-a1fb-c64c0f954d0c

📥 Commits

Reviewing files that changed from the base of the PR and between 5234fbd and 2d2acb5.

📒 Files selected for processing (1)
  • src/Migration/Sources/Appwrite.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Migration/Sources/Appwrite.php

Walkthrough

The exportDatabases logic now records an originalType (the database type from payload, with legacy defaults) and computes a databaseFamilyType used for support checks and selecting the Resource subclass. Support/getDatabase decisions use databaseFamilyType, while emitted resources keep type as originalType. The emitted database payload now includes the original database field and preserves enabled (defaulting to true if absent). Public method signatures are unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: preventing database type from being overwritten by family type, which aligns with the core fix of preserving originalType while using databaseFamilyType for support checks.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-database-family-type

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

'name' => $database['name'],
'createdAt' => $database['$createdAt'],
'updatedAt' => $database['$updatedAt'],
'enabled' => $database['enabled'] ?? true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep enabled here

'permissions' => $table['$permissions'],
'createdAt' => $table['$createdAt'],
'updatedAt' => $table['$updatedAt'],
'enabled' => $table['enabled'] ?? true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@abnegate abnegate merged commit a27c3c6 into main Mar 12, 2026
4 checks passed
@abnegate abnegate deleted the fix-database-family-type branch March 12, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants