Hassle-Free Database Migrations with Prisma Migrate
1–10 of 28 posts
Re: Hassle-Free Database Migrations with Prisma Migrate
#2What i need more is a smart ORM which gives me tool to calculate dependent fields based on other fields changes, then automatically store it on a field. Secondly, it should provide smart many2many relationship with smart caching techniques.
Those are features that prevents me to continue with RoR.
Re: Hassle-Free Database Migrations with Prisma Migrate
#3Database schema is not actually the most important thing i need to be a productive programmer. What i need more is a smart ORM which gives me tool to calculate dependent fields based on other fields changes, then automatically store it on a field. Secondly, it should provide smart many2many relationship with smart caching techniques. Those are features that prevents me to continue with RoR.
I think Prisma might cover "smart many2many relationships". What exactly do you mean by smart caching techniques? Prisma is applying the dataloader pattern from GraphQL automatically under the hood, which we find to be a much easier thing to reason about compared to all the complexity of multi-tiered caching in Hibernate.
The dependent field requirement is super interesting, and something we will tackle in the future based on Change Data Capture. With Prisma you will be able to write a simple declarative data transformation, and the system will automatically keep the field up-to-date, even if the database is changed by another application, or manually by a user.
Hope that makes sense? :-)
Re: Hassle-Free Database Migrations with Prisma Migrate
#4Database schema is not actually the most important thing i need to be a productive programmer. What i need more is a smart ORM which gives me tool to calculate dependent fields based on other fields changes, then automatically store it on a field. Secondly, it should provide smart many2many relationship with smart caching techniques. Those are features that prevents me to continue with RoR.
Re: Hassle-Free Database Migrations with Prisma Migrate
#5We've been working on a similar tool that we've since donated to the CNCF and is now a Sandbox project (https://schemahero.io) that uses YAML to define a schema, and it's controlled by a Kubernetes operator. We realized that version control for the schema is great, and then you get GitOps integration so you can easily deploy and rollback. One of the compelling values of YAML for us was a) Kubernetes, so it's a default and b) Open Policy Agent can start to introduce a policies.
Prsima Migrate looks great. I think we'll see more tools like this as folks want to version control and implement policies and store metadata around their schemas to tightly couple the deployment to the app version.
Re: Hassle-Free Database Migrations with Prisma Migrate
#6When I make a schema migration locally and push it to the repository, then 3 other PRs with their own migrations are being merged before mine, it is very likely that my local database will be in the wrong state.
Correct me if I'm wrong, but using an ORM (be it Django, Prisma, liquibase, ...) to handle your migrations will only generate the SQL queries for you, it won't handle "migration history merges" which is what you'll most likely need.
Your schema may be versioned in your repository, but not your data.
Therefore, you still need to coordinate your developers when database change are needed. And you'll most likely need to rm -rf your database locally and recreate it.
Unfortunately, that is not an easy problem to solve. Fortunately, this should not be a problem on production environments (where their history is more linear).
I'd be curious of any work on that subject.
Re: Hassle-Free Database Migrations with Prisma Migrate
#7Database schema is not actually the most important thing i need to be a productive programmer. What i need more is a smart ORM which gives me tool to calculate dependent fields based on other fields changes, then automatically store it on a field. Secondly, it should provide smart many2many relationship with smart caching techniques. Those are features that prevents me to continue with RoR.
Is the ORM really the layer where you want those features? Because at the RDBMS layer you have views, materialized views, and triggers for that.
If you really want this at the ORM level, you can do it in RoR with e.g. model callbacks or custom attribute writers.
> Secondly, it should provide smart many2many relationship with smart caching techniques. Those are features that prevents me to continue with RoR.
RoR's many2many associations already do caching, though.
I don't see what you're lacking with RoR on either point.
Re: Hassle-Free Database Migrations with Prisma Migrate
#8What I need from migrations is collaboration. When I make a schema migration locally and push it to the repository, then 3 other PRs with their own migrations are being merged before mine, it is very likely that my local database will be in the wrong state. Correct me if I'm wrong, but using an ORM (be it Django, Prisma, liquibase, ...) to handle your migrations will only generate the SQL queries for you, it won't ha…
We are taking inspiration from this great writeup on how Github has implemented a workflow that enable their developers to collaborate on Schema Migrations at scale: https://github.blog/2020-02-14-automating-mysql-schema-migra...
Re: Hassle-Free Database Migrations with Prisma Migrate
#9What I need from migrations is collaboration. When I make a schema migration locally and push it to the repository, then 3 other PRs with their own migrations are being merged before mine, it is very likely that my local database will be in the wrong state. Correct me if I'm wrong, but using an ORM (be it Django, Prisma, liquibase, ...) to handle your migrations will only generate the SQL queries for you, it won't ha…
Re: Hassle-Free Database Migrations with Prisma Migrate
#10Congrats on releasing this. I'm a big believer in declarative schema management. Migrate looks great, and I like how it allows autopilot, but that workflow step to inspect the generated migration AND to alter it, if it's incorrect or sub-optimal. This looks like a great tool. We've been working on a similar tool that we've since donated to the CNCF and is now a Sandbox project ( https://schemahero.io ) that uses YAML…
SchemaHero looks super interesting. I'll check with the team to make sure they take a look. Introducing a Kubernetes operator is pretty ambitious.