BluePenguin
BluePenguin3h ago

Rename table through migration while maintaining _creationTime

I want to rename a table. I understand it's not directly possible; only through migrations. But, we're running into the issue that all _creationTime fields are now reset. I also don't seem to be able to write those during the insert. I tried adding a new creationTime field, but now I have to add it to all indices to maintain the same ordering as before. Anyway a mess. This must be simpler right?
3 Replies
Convex Bot
Convex Bot3h ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
Clever Tagline
Unfortunately not. _creationTime is a system field, and system fields can't be altered by your code. Your method of adding another field to the new table is the only way that I'm aware of to maintain the original creation time value. Yeah, it's a mess, but there's no alternative currently.
BluePenguin
BluePenguinOP2h ago
Allright, thanks for the response 🙏 . I'll just live with the old title for now for the sake of keeping the speed.

Did you find this page helpful?