ceramicnetwork / ceramicnetwork/js-ceramic
`ModelInstanceDocument doc.replace`, there are some fields that are not updated in db table
- Dominant language
- TypeScript
- Stars
- 423
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
``` javascript
const doc = await ModelInstanceDocument.create(ceramic, CONTENT0, midMetadata)
await doc.replace(CONTENT1)
```
but in postgress ,the db table only updates 2 fields(last_anchored_at&updated_at) when doc updated, CONTENT1 data is not updated to table,maybe other fields should be updated as well
https://github.com/ceramicnetwork/js-ceramic/blame/33e3c0969c0161d5dc17b55501775385241066be/packages/core/src/indexing/postgres/postgres-index-api.ts#L57
**Screenshots**
If applicable, add screenshots to help explain your problem.

Contributor guide
No contributing guide indexed for this repository
Research direction
Start in packages/core/src/indexing/postgres/postgres-index-api.ts around line 57 and reproduce the ModelInstanceDocument.create and doc.replace sequence shown in the issue. Compare the database row before and after replacement to determine which document fields remain unchanged; done means the expected CONTENT1 data and relevant updated fields are persisted in PostgreSQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100