
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
- Help on importing data - error Unknown a...
Hey There! I want to create a local environment on my new computer, i wish to get the information i have on my staging appwrite cloud server. When running mig...
- login backend and frontend
I'm using Remix, as my Backend (node). and react on my frontend. Until now, i did SSR login. saved the secret.. and it's fine. For many simpler requests i wish...
- How to get database file, like JSON or D...
Hi Appwrite team, I want to get database file to share database to another, btw, I can not found any thing like Download button inside Backup tabs. What can I d...
