Replies: 1 comment 1 reply
-
I'm open to accept a PR that changes this PR as long as it does not break anything else and comes with a test. I do not have any clear ideas yet on how to implement that, but I would like to avoid the code duplication of having yet another |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When running
diesel migration list
, the CLI tool tries to create the table__diesel_schema_migrations
if it doesn't already exist. This looks to have come from #2062 which tries to make sure that the migrations table is always available to get the current migration state.This has a downside, that the user always needs CREATE permission on the schema (at least, for Postgres), which could have been unnecessary in cases where the table already exists. I would like it to be possible to list migration state without needing this permission. It would reduce friction in getting the migration state from databases which are sensitive enough that one doesn't want to easily modify the schema.
One approach I can imagine is a custom
MigrationConnection
that skips this setup step; but this means not using the standard diesel_cli, which is otherwise working well.A second approach might be to add a command-line flag or config file setting to skip the migration setup, i.e. either change the behavior of
applied_migrations
, or more broadly.Maybe there might be some possibilities in PL/pgSQL to check the table existence and skip creation if it does?
Would there be any interest in making this possible for the diesel CLI?
Beta Was this translation helpful? Give feedback.
All reactions