I'm experiencing a critical bug with Appwrite CLI that causes complete data loss when making minor schema changes to relationship attributes.
What I Tried To Do:
Changed a relationship attribute's onDelete property from "setNull" to "restrict" in my appwrite.json:
{
"key": "templateListing",
"type": "relationship",
"onDelete": "restrict" // Changed from "setNull"
}
What Actually Happened:
When running appwrite push collections, the CLI:
- Deleted the entire relationship attribute
- Destroyed all existing relationship data between Templates and TemplateListings
- Failed to recreate the attribute due to caching issues
- Left my database in a broken state with all relationship data permanently lost
Expected Behavior: Changing onDelete behavior should be an in-place schema update that:
- Updates the constraint without touching existing data
- Preserves all existing relationships Only affects future deletion behavior.
Actual Impact:
- Complete data loss of all Template ↔ TemplateListing relationships
- Production database corruption from a simple config change Hours of work to manually restore relationships.
Request:
Please fix the CLI to handle relationship schema changes without data loss. Database systems should never delete user data for configuration changes. This behavior makes Appwrite unsuitable for production use where data integrity is critical.
Environment:
Appwrite CLI: 6.1.0 Database: Cloud hosted
Recommended threads
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- 500 Server error
getting same 500 status This is my appwrite project: https://cloud.appwrite.io/console/project-fra-691932db0036241caa0e/overview/platforms Help how to open th...