Trying to update existing schema for "other deployment"
Hey guys, I just recently joined another project that uses Convex. They have a production deployment, used for production of course, and an "other deployment" deployment that is used for testing.
I am being tasked with updating the
schema.ts by adding two new tables; which I have added.
Now I am trying to update the existing "other deployment" deployment, however I can't seem to figure out the right flow.
I run "npx convex dev", select the team, select the existing project, and then it automatically pushes to my own SEPERATE cloud deployment.
Glad to share any other information, I just don't know what would be helpful.
How can I push these changes to my co-workers existing development deployment? Thanks!31 Replies
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!
good morning, bumping this!
Bumping again! I can share more information if its needed
That existing deployment. Are you added as a member on that?
Do deployments have the ability to add members to them? I can't find anything in their settings.
However in the project settings I can see who the admins are
Yes you can right from 'Team Settings' from your Team page.

When selecting team and existing project you need to make sure you choose th existing project.
Gotcha, so yes I am a member of that team, that team manages the project, of which the deployment belongs to
From CLI when you do npx convex dev.
Ahhhh I see, I'm a Developer, but I'm not particularly added to any projects

Also something to consider. When you'll do that make sure all existing functions exist in convex folder otherwise it'll be overwritten to what code you have.
there we go!
very important note thank you
and thank you! I'll ask for permissions and i'm sure that will fix it
@Hmza I was added the admin role, and I ran npx convex dev and it defaults to my cloud deployment and never provides me an option to use the other deployment
can you try logging in again? also please make sure to remove any enviorment variables related to convex from your root directy in file .env.local or .env
when convex will not find a project attached it'll ask you to select team and projects again. then you can select the correct one.
Hi @Jacob Homanics did you beable to solve this? I'm encountering the same situation, too.
My friend and I are joining the same project. However, when we clone the code on our personal laptops and start the
convex dev, it starts two separated deployments DBs
When I try to change the .env.local's URL to my friend's one -> start the convex dev, it auto override the URLs
So I assume we can't join the same (dev) deployment from multiple PC right?
Also, I think we aren't be able yet to delete the dev cloud deployments. I'm a bit nervous for Convex team to see multiple dev DBs live there (forever) without beable to delete them, haha 😂I'm am actually re-visiting this problem as I'd like to use the other DB as well. However, running
npx convex dev does indeed override the .env variables
I just tried this.
It finds the correct project, but not the correct database. It auto-uses the database tied to me (my PC?). I am unable to test with the database that my co-worker has createdPlease clarify when you say database tied to your PC? No database is tied to your pc. When you are logged in to your convex account and you run npx convex dev. Does it ask you to select team? It should and then you select the project and it’ll automatically create .env.local with correct dev deployment url. Let me know if that is not the case. A short video would help too to understand the problem better.
It seems there is a database tied to either the user or a PC.
For instance, when I run
npx convex dev organically, it will give me the database named: fearless-spaniel-XXX.
When my coworker runs the same command organically it gives her the database pleasant-panther-XX.
When I am logged into my convex account and I run npx convex dev it DOES ask me to select a team (I select our team), then it asks to select a project (I select the project), then it DOES automatically create the .env.local with MY deployment url.
However, I want to use pleasant-panther-XX not fearless-spaniel-XXXYou both want to use same deployment at same time to deploy? I think i didn’t get it right the first time
I think you will have to go on route where only one person deploys. And certainly other person can use those deployed functions
https://stack.convex.dev/multiple-repos
Convex in Multiple Repositories
Turns out, you can organize your Convex project across multiple repositories! Check out this guide on how to implement this in your project.
I've got both personal and work accounts with Convex. It's been a while since I switched between them, but there's an option with the
npx convex command where you can force it to ignore the data stored in .env.local and instead take you to the login prompt anyway. I'm digging trying to find it, and I'll share it once I've located it.Its the same repository
This is driving me nuts. All that I can remember is that it includes the
-force (or maybe it's --force) flag, but digging through the help docs for the command isn't showing me anything that uses that flag.
You could always do npx convex logout, then run npx convex dev again to log into the other account.
Still searching for the other command that I used to useAt least in my case, I don't think its an issue with the account/projects not showing up
I think it's
npx convex login --force. Using that you won't need to log out first.
What's odd is that the login command isn't listed when I do npx convex --helphere's a video showcasing what mean. @Hmza hopefully this helps make it clearer: https://www.loom.com/share/968d09f6f6ea4d06ab84d7a20ad21244?sid=20c55b40-5862-47f9-91c7-21bba94f92be
Loom
Switching Databases in the Disco Project 🔄
In this video, I walk you through my disco project, highlighting the development cloud I've been using to build my application. I also mention another deployment called disco Lynette Stove, specifically the Pleasant Panther one. My application currently references the Fearless Spaniel database, and I would like to switch over to a different data...
Ah, gotcha. Thanks for the clarification.
Unfortunately I don't think it's possible to switch. Each team member on the project has their own private dev environment, and I'm not aware of a feature that allows you to use the dev environment of another team member.
At least that's what my memory is telling me
Is there a way to "duplicate" her database so that I can make a "soft copy" of it and use that instead?
There's a command option for the
convex CLI command that lets you export the data. She can export on her end, then you can import to yours. I've not used those features before, so I'm not sure how involved the process might be.
Run npx convex help export for more infoThere's also online reference in the docs: https://docs.convex.dev/cli
CLI | Convex Developer Hub
Command-line interface for managing Convex projects and functions
@Clever Tagline thanks, I think thats the best soluton for now. I needed to create a backup of her database, then restore that backup into my database
This gives me a "soft copy" of her database.
However, it would be nice in a future version to have:
1. The ability to more directly copy her database.
2. The ability to more directly use her database.
Those definitely sound like useful features. If you want, tag this post with "Feature Request" so that the devs see it. No guarantee that they'll add those, but at least they'll know what would help you in your use case.
For sure. Appreciate the help and hope those become features ❤️