postgres-migrations icon indicating copy to clipboard operation
postgres-migrations copied to clipboard

schema of migrations table

Open dlidstrom opened this issue 3 years ago • 5 comments

Is it possible to specify the schema of the migrations table? I'd like to separate tables by schema, and have separate migrations for each schema. That way, I can do drop schema ... cascade to recreate parts of my database. This would allow me to iterate fast on a schema while preserving any information I might have in other schemas.

dlidstrom avatar Jun 04 '21 13:06 dlidstrom

Thanks for the issue.

At the moment, no, there isn't a way.

There are a bunch of issues and PRs about similar issues to do with the schema and problems with the search path. Please have a look around.

Until someone solves this whole problem, backwards compatibly (or with an upgrade path if not possible), with appropriate tests and documentation, then I don't think this is going to get fixed soon. I simply don't have the time/energy to focus on this right now.

ThomWright avatar Jun 04 '21 14:06 ThomWright

Ok, no problem. Thanks for the quick reply and for being honest.

dlidstrom avatar Jun 04 '21 15:06 dlidstrom

@dlidstrom https://github.com/jbelelieu/pg_node_migrations

jbelelieu avatar Sep 24 '21 15:09 jbelelieu

I solved my migration issue with DbUp and <50 lines of F#.

dlidstrom avatar Sep 24 '21 21:09 dlidstrom

If #93 is merged I believe it would become possible to set a search_path on a client before running migrations and passing that client to the migration command.

slifty avatar Jul 13 '22 17:07 slifty