Open
Description
Is your feature request related to a problem? Please describe.
In Postgres server, I need to perform these steps in these exact order:
- Call a function in "postgres" database (
pgaadauth_create_principal()
) - Create schema objects in "my-application" database
- Call a function in "postgres" (`cron.schedule_in_database(... , ... ,'my-application'))
Describe the solution you'd like
To be discussed, but:
- Add some hooks, that will allow to run custom C# code before or after migration step, such as:
This would allow me to write custom C# code that executes custom script in different database.
void BeforeUp();
public void BeforeUp() { using var connection = new NpgsqlConnection(postgresConnStr); connection.Open(); using var jobCommand = connection.CreateCommand(); jobCommand.CommandText = $""" SELECT cron.schedule_in_database('{CleanupJobName}','0 1 * * 6', 'CALL "{AppSchema}"."DbCleanup"();', """; jobCommand.ExecuteNonQuery(); }
- Allow connection string customization per migration
- Allow to setup multiple Migrators each with its own set of migrations and connectionstring + create RunnerOrchestrator
Is this a feature you'd like to submit a PR for?
if we agree on API design...