React Developer
I’m hitting a blocking issue creating rows in Appwrite (both from the console and my React Native app). After successfully inserting the first row, every subsequent create fails with:
[AppwriteException: Row with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.]
It looks like the document ID is being treated as already used even when I expect a new unique ID. I only have one two-way one-to-one relationship between two tables. After the first insert, I can’t add any more records.
Schema (essential parts):
Table: profiles
- Columns: gender (enum: male|female), dob (datetime, required), marketing_opt_in (bool), user_id (string, size 36, required), full_name (string, 128, required), email (string, 254), phone_e164 (string, 32, required), locale (string, 8, required), profile_picture (url)
- Relationship:
secure_id→profiles_secure(oneToOne, twoWay=true, twoWayKey=profile_id, onDelete=cascade, side=child) - Permissions: read("users")
- Indexes: none
Table: profiles_secure
- Columns: pregnancy_status (enum: na|pregnant|postpartum), breastfeeding (bool), cni_number (string, 32), allergies (string[], 128), emergency_contact_name (string, 128), emergency_contact_phone_e164 (string, 32), consents (string, 4096)
- Relationship:
profile_id→profiles(oneToOne, twoWay=true, twoWayKey=secure_id, onDelete=cascade, side=parent) - Permissions: read("users")
- Indexes: index_cni (ASC)
Notes:
- The error occurs immediately after the first
profilesrow is added. - I expected Appwrite to generate a unique document ID (or to honor
ID.unique()), but the platform behaves as if the same ID is reused. - Only change since it worked: adding the two-way one-to-one relation above.
Any ideas why additional creates are hitting “Row with the requested ID already exists”? Is there something about two-way one-to-one relations or document IDs I might be misconfiguring?