W
Wasp3mo ago
sachdva

Probably a docker question, but -- PGVector

I install pgvector on docker on local deployment, everything is fine and works and I get this every time I restart the database and it asks me to migrate. I migrate, and database says already up to date, nothing to migrate. 🐝 --- Setting up database... ----------------------------------------------------- [ Db ] [+] Added extensions [ Db ] - plpgsql 👀 --- [Warning] Your wasp project reported following warnings during compilation: --- - Your Prisma schema does not match your database, please run wasp db migrate-dev.
8 Replies
kapa.ai
kapa.ai3mo ago
Hi @A³Learn. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The warning you're seeing—"Your Prisma schema does not match your database, please run wasp db migrate-dev"—is a known situation in Wasp projects, especially when using features like pgvector or running your database in Docker. Here's what's happening: - Wasp tracks whether your Prisma schema (which defines your database structure) is in sync with your actual database. - If Wasp detects a difference (for example, after restarting your database or making changes to entities), it warns you to run wasp db migrate-dev to synchronize them. - However, sometimes, even after running wasp db migrate-dev, you may see "database is already up to date, nothing to migrate," but the warning persists. This can happen because Wasp uses a checksum or a similar mechanism to detect changes in the generated Prisma schema file. If the checksum or tracking file is out of sync (for example, after a Docker restart or if the migration history is not perfectly aligned), Wasp may continue to warn you, even if the actual database and schema are in sync. This is discussed as a known issue and improvement area in the Wasp project, with suggestions to improve how Wasp checks for schema/database sync and warnings about migrations. The warning is meant to help prevent situations where the Prisma client or database schema is stale, but it can sometimes be overly cautious or get "stuck" after certain operations, especially in Dockerized environments or when using extensions like pgvector Warn user if Prisma needs to be re-generated, Consider using prisma migrate status or prisma db pull to improve DB migration warnings. What can you do? - If wasp db migrate-dev reports that everything is up to date and your app works as expected, you can safely ignore the warning. - If you want to clear the warning, try running wasp clean and then wasp start to reset generated files and force Wasp to re-check everything. This has helped some users in similar situations, especially after changes to the database or environment Discord support thread: Help with Wasp Embedding template / seeding the db. Summary:
The warning is a safety feature, but it can sometimes persist even when your database and schema are actually in sync, especially with Docker and extensions like pgvector. As long as wasp db migrate-dev says there is nothing to migrate and your app works, you can ignore it or try a clean/restart cycle to clear it. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @A³Learn, 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?
sachdva
sachdvaOP3mo ago
Will ignore then!
toticozeni
toticozeni3mo ago
I would just ask @miho or @Filip to do a quick scan on question if that is really what happens. Since they should more know about the Prisma processes.
Filip
Filip3mo ago
I remember something about false postives here, but Miho will know more
miho
miho3mo ago
@A³Learn could you share how you start the DB with Docker?
sachdva
sachdvaOP3mo ago
Ah whatcha mean, just wasp start?
miho
miho3mo ago
You said
pgvector on docker on local deployment,
so I was wondering, what is the Docker command you use to run the database and how you installed the pgvector?
sachdva
sachdvaOP3mo ago
Using WSL2 I go into the db and run
apt update
apt install postgresql-16-pgvector
apt update
apt install postgresql-16-pgvector
via the exec tab. It is to note, that I often have to repeat this command (every day or so) I would also be interested to know, why 16 and not 17

Did you find this page helpful?