noob saibot
noob saibot•12mo ago

Renaming tables

Hi all. I'm new to convex. When Is it possible to change the name of an existing table? When I rename a table in the schema.ts file, I'm observing that a new table is created while the old table stays.
4 Replies
erquhart
erquhart•12mo ago
Hey 👋 Renaming a table isn't actually possible currently - you'll need to create a new table with the name you want, and copy the data from the old table over.
lee
lee•12mo ago
(and then you can delete the old table in the dashboard)
noob saibot
noob saibotOP•12mo ago
Thanks for the reply, @erquhart Is there a command in the dashboard to copy data over the new table?
erquhart
erquhart•12mo ago
No, you’ll need to write convex functions to copy the data over. The good news is it’s pretty trivial to do so. If you’ve ever worked with databases before, this is analogous to a simple migration.

Did you find this page helpful?