-
Notifications
You must be signed in to change notification settings - Fork 78
If statement in migration scripts? #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is not. There's no plans to support this. Is this something that you can handle with different modules? |
@Pacane Did you get around this issue? Can this be closed? |
You might want to have a look at alternative tools that can support database neutral migrations. One I know of FluentMigrator (you write C# migrations and it generates SQL for the target database). You may still need to SQL platform specific code for Stored procs, Functions, Triggers etc. I wrote an extension for FluentMigrator to assist doing this in a fork. It allows you to selectively run some scripts for different platforms based on SQL file/folder naming conventions. |
Sorry for the slow response. You can do this by combining the scriptpath and env variables as an alternative. It sounds like you already have environments setup for both db vendors, you can setup script paths separately for them as well. |
#64 was created |
Is there any way to use some conditional logic in a migration script? I have 2 databases (hsqlb and postgres) and it seems sometimes their syntax differ. I'd like to run specific parts of migration scripts based on the selected environment.
The text was updated successfully, but these errors were encountered: