W
Wasp•3mo ago
Jacky

When do I have to run wasp db migrate-dev for Open Saas?

When do I have to run wasp db migrate-dev for Open Saas? Running wasp db migrate-dev takes about an Hour and really slows things down for Development
5 Replies
kapa.ai
kapa.ai•3mo ago
Hi @Jacky. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Jacky
JackyOP•3mo ago
Hi Kapa
kapa.ai
kapa.ai•3mo ago
---------------------- Based on the information provided in the knowledge sources, here's what you need to know about running wasp db migrate-dev for Open SaaS: 1. You should run wasp db migrate-dev after making changes to your data model (entities) or when setting up a new project. This command synchronizes your development database with the current state of your schema Docs > General > CLI Reference (https://wasp-lang.dev/docs/general/cli#database-commands). 2. For Open SaaS specifically, you need to run this command during the initial setup process, as mentioned in the Getting Started guide Discord support thread (https://discord.com/channels/686873244791210014/1209260641966235728). 3. It's important to note that wasp db migrate-dev should be run in a separate terminal window from the one running your database. You should first start your database with wasp start db in one terminal, then run wasp db migrate-dev in another Discord support thread (https://discord.com/channels/686873244791210014/1209260641966235728). Regarding the long execution time you're experiencing: The command shouldn't typically take an hour to run. Long execution times or hanging issues have been reported by some users, particularly on systems with limited resources: 1. One user reported issues on an EC2 micro free tier instance with only 1GB of memory Discord support thread (https://discord.com/channels/686873244791210014/1217483832404611195). 2. Another user experienced a long execution time (~40 minutes) on a fresh Ubuntu 22.04 VPS Discord support thread (https://discord.com/channels/686873244791210014/1213593156646604820). These long execution times are not normal and may indicate underlying issues with your setup or system resources. If you're consistently experiencing hour-long execution times, you might want to: 1. Ensure you have sufficient system resources. 2. Check for any error messages in your database logs. 3. Verify your database connection settings. 4. Consider reaching out to the Wasp community for further assistance with your specific setup. Remember, wasp db migrate-dev is primarily needed when you make changes to your data model or during initial setup. For regular development work, you shouldn't need to run it frequently. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Jacky, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
miho•3mo ago
Running wasp db migrate-dev takes about an Hour
That's not expected! Are you running Wasp on Windows/WSL? To answer your initial question, you should run wasp db migrate-dev after you change the schema.prisma file 🙂
martinsos
martinsos•3mo ago
@Jacky if you can give any information on your system (Is it WSL? If so ,wihch version?), it would be great, so we can identify what might be causing this slowdown for you.

Did you find this page helpful?