How are other people using Prisma in production if...
# orm-help
a
How are other people using Prisma in production if
prisma migrate
is still not production ready?
👍 1
j
The general workflow is to manually make schema changes, and then introspect
The intent is that the Prisma client is a largely separable product from Prisma migrate. You can use these essentially independently from one another
The prior is just what was built first - and Prisma migrate should be GA relatively soon
plus one +1 1
(Using "relatively" rather loosely, as they haven't shared any specifics)
a
I see.. hmm, so right now the best practice is to manually make migrations and introspect. But I imagine this being a huge pain with teams no?
I come from knex.js and so each dev can easily create migrations, push to repo, deal with conflicts. We can also easily migrate a prod db up and down in case of any issues.
Are these all things the
prisma migrate
GA version will have?
I guess I’m curious how anyone would be using prisma in production on a project that involves multiple developers.
j
Yep, the currently available version can do that - minus migrate down. They had an explanation for why, let me see if I can dig that up
a
ah thank you so much, appreciated
Skip down to "Lack of rollbacks / Down migrations"
a
Hmmm, interesting. I guess that’s a good point. I’ve rarely if ever migrated down a production DB.
Ok, well aside from that,
prisma migrate deploy --preview-feature
is still technically --preview-feature.
so I should not be using it in production? I guess that’s what you mentioned about people manually running migrations in production earlier?
j
My best advice is preview = beta, so your organization's needs & risk profile determine if that's appropriate
FWIW basically all it's doing is autogenerating a SQL file for you which you can edit however you want and then run at will
💯 2
a
Right, makes total sense. Very helpful - really appreciate your thoughts here. Thank you!
r
I've been using it for the last year without an issue ..
(in production)
a
Thanks @Richard Ward for the input! Are you generating your SQL migrations for production?
r
I'm using
"postinstall": "yarn prisma generate && yarn prisma migrate deploy --preview-feature ",
in my
package.json
which Heroku uses when deploying
a
awesome! Doing something similar. Thx 🙂
👍 1