I'm exploring blue/green deployment and zero-down-time releases, and would love to know if I can get prisma migrate deploy to give me all of the SQL it's going to run as a string?
For example, lets say we add a column to a table
- we'd have a file in
prisma/migrations/[datetime]_add_column/migration.sql prisma migrate deploywould theoretically run the contents of that file in a DB- and then it would run
insert into _prisma_migrations (id,checksum,finished_at,migration_name,logs,rolled_back_at,started_at,applied_steps_count) values (...)
I'd live to be able to use gh-ost to do the DB migrations in a non-blocking way, so I can keep my site up while deploying and only have a little blip as one docker image stops and the other starts up. But to do that I'd need to get all of the migration SQL and the _prisma_migrations insert/update SQL as a string, I believe.
Is there a way I can coax from Prisma all of the SQL it's going run run as migrate deploy as a string (assuming success)? Ooh, or maybe I can get 2 strings: what to run if success, and what to run in the case of failure!