QuinnQ
Convex Community6mo ago
2 replies
Quinn

Overriding creationTime after migrating to Convex

Hi - I'm exploring migrating my project to convex from postgres, so far everything has been smooth but my existing tables currently have a createdAt field that I want to preserve in _creationTime. However, although the types on the patch function suggest that setting _creationTime would be allowed, performing a migration to set modify the time to my existing createdAt time fails.

There are times in my app where I sort over or display this time, so it is important to me that it is persisted, and it would be nice to not have to manually handle adding the time for future documents, since the feature already exists in the db.

Is there a way to set the _creationTime field for this case, or another suggested workaround?
Was this page helpful?