hello! I want to add a CI-job to make sure no sch...
# prisma-migrate
k
hello! I want to add a CI-job to make sure no schema changes have been done without corresponding migration files have been added. Had a near-miss today where we could’ve borked a whole table. Is there a command I can run that can check if the current db schema is up-to-date with the current schema? similar to how
migrate dev
works where it prompts you but I just want to make sure no schema changes are checked in without the migration files
when running
yarn migrate dev
in CI it just seem to automatically create the missing migration rather than failing
I would expect this to fail in CI but rather it just creates a missing migration file
r
@KATT 👋 Unfortunately we don’t have any command that does this at the moment. There could be a command like
migrate diff
that performs this. It would be great if you could create a feature request here so that we can look into this 🙂
k
I’m doing a hack now that is doing a
git diff
and fails the job if there’s a diff after running
migrate dev
👍 1
r
A feature request would be great though! We would like to implement this 🙂
k
j
Hello! Just answered there, maybe that helps: https://github.com/prisma/prisma/issues/9707#issuecomment-940936792
k
i answered back 🙂
yarn migrate status
will say “Database schema is up to date!” even if i’ve updated my schema and generated prisma types
Copy code
--create-only   Create a new migration but do not apply it
                    The migration will be empty if there are no changes in Prisma schema