Since the prisma migrate API is experimental I ass...
# orm-help
d
Since the prisma migrate API is experimental I assume it's not recommended to use in a prod environment, what would you use for database migrations instead?
r
Hey @Daniell 👋 Currently we have introduced an updated version of Migrate that you can check out here. This supports fine-tuning migration files with SQL statements where you can add anything from constraints to functions. The current approach recommended in production is to use introspection and for migrations you can either use plain SQL or if using Postgres, you can use something like node-pg-migrate.
You can test out the Migrate flow and let us know your thoughts on that 🙂
d
I have been using it for personal projects but now I get to rewrite an API for a startup, I am afraid it's going to miss important features
r
Any features that you found missing?
d
I can't think of any right now, I will give it a try
💯 2
r
Do let us know so that we can improve with some additions as well 🙂
d
Hey Daniell, Just wanted to share that the new version of Migrate has just been promoted to Preview. While it’s not fully production ready as Ryan mentioned, it’s here to stay and will form the basis for the production ready version. You can read more in the release blog post: https://www.prisma.io/blog/prisma-migrate-preview-b5eno5g08d0b
🙌 1
d
Are there any important features that you know of that makes this not production ready yet? What more is there to be achieved before it's ready? I am not that good at sql for creating tables so I tend to use ORM's often to create my database, the project I'm working on is for a startup so I do have the time to experiment a bit
I guess it's only the native db types mentioned in the blog which isn't the biggest issue when manually updating, would you say yes to using the api for this project? 😅
d
In terms of features, there’s support for native types is missing in addition to seeding which we’re hoping to get into the GA release. Besides those, we’re using this time to verify that there aren’t any edge cases that cause bugs before we label it production ready. Especially because the database is such a critical and sensitive piece of infrastructure. We want to be absolutely confident that it won’t cause anything unexpected
I am not that good at sql for creating tables so I tend to use ORM’s often to create my database,
The new version of Migrate should help with that. My suggestion would be to give it a go and see how it’s working for you.
would you say yes to using the api for this project?
Can you share some more context on what you mean? If I understand you correctly, you’re building an API backed by a database with Prisma Client and Migrate. The Prisma Client part is production ready. It’s the Migrate part that is still not fully production ready yet.
d
Hm what does that seeding imply? Currently I am rewriting a project that is using Knex and a mysql database but the database is poorly designed so can rework that too, I am going to move to a postgres database, I think I wont have a lot of missing native types issue since as far as I know mysql doesn't have a lot, I checked through the database and the only types used in the old project I see are varchar, float, int, tinyint, enum, datetime
d
Hm what does that seeding imply?
Seeding is the ability to fill the database with data. It’s not a critical piece for migrations but useful when working with many branches/collaborators and you want the ability to quickly fill the database with data.
I think I wont have a lot of missing native types issue since as far as I know mysql doesn’t have a lot, I checked through the database and the only types used in the old project I see are varchar, float, int, tinyint, enum, datetime
All these types should work with Prisma Client and Migrate. To use smallint you would have to modify the SQL that is generated by Migrate. But besides that, you should be fine functionality wise. Let me know if you have any more questions 🙂
d
Okay I will use the migrate api, thanks for the quick answers, I guess my only question left is if @nexus/schema with nexus-plugin-prisma supports the prisma version with the preview future but could figure that out myself
👍 1
d
@nexus/schema with nexus-plugin-prisma should work with 2.13.0. The PR was just merged I should note that for Prisma Client and @nexus/schema (and nexus-plugin-prisma), it doesn’t really matter how you create the database. If Prisma Client works with a database (with introspection or using Migrate), the nexus parts should also work.
d
Oh thanks! That is coincidence because I was planning on using nexus schema, do you know how to install this specific version by any chance?
🙌 1
2 hours ago, nice
d