SHAFI commited on
Commit
aa2e207
·
1 Parent(s): 6964e58

fix(db): correct cloud collection schema mapping

Browse files

- Cloud collection expects 'published_at' (snake_case), not 'publishedAt'
- Only 'image' field uses legacy naming (image vs image_url)
- Resolves 'Missing required attribute published_at' errors

Files changed (1) hide show
  1. app/services/appwrite_db.py +2 -5
app/services/appwrite_db.py CHANGED
@@ -403,11 +403,8 @@ class AppwriteDatabase:
403
  if 'image_url' in document_data:
404
  document_data['image'] = document_data.pop('image_url')
405
 
406
- # FIX: Cloud collection uses legacy 'publishedAt' attribute, not 'published_at'
407
- # Based on logs, other collections accept 'published_at' (snake_case)
408
- # But Cloud might strictly require 'publishedAt' (camelCase)
409
- if 'published_at' in document_data:
410
- document_data['publishedAt'] = document_data.pop('published_at')
411
 
412
  # Try to create document
413
  self.tablesDB.create_row(
 
403
  if 'image_url' in document_data:
404
  document_data['image'] = document_data.pop('image_url')
405
 
406
+ # NOTE: Cloud collection DOES accept 'published_at' (snake_case)
407
+ # Only the 'image' field uses legacy naming
 
 
 
408
 
409
  # Try to create document
410
  self.tablesDB.create_row(