如何忽略Flyway的占位符表达式? [英] How to ignore placeholder expressions for Flyway?

查看:421
本文介绍了如何忽略Flyway的占位符表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是flyway 2.3版,我有一个SQL修补程序,该修补程序将varchar插入到具有Flyway视为占位符的字符序列的表中.我想跳过所有占位符并按原样运行脚本.

I am using flyway version 2.3, I have an sql patch which inserts a varchar into a table having character sequence that Flyway treats as placeholders. I want to flyway to ignore placeholders and run the script as is.

脚本文件是

insert into test_data (value) values ("${Email}");

Java代码是

package foobar;

import com.googlecode.flyway.core.Flyway;

public class App 
{
    public static void main( String[] args )
    {
        // Create the Flyway instance
        Flyway flyway = new Flyway();

        // Point it to the database
        flyway.setDataSource("jdbc:mysql://localhost:3306/flywaytest", "alpha", "beta");

        // Start the migration
        flyway.migrate();
    }
}

推荐答案

您可以将占位符后缀或前缀的值更改为其他值,并且应该没问题.

You can change the value of the placeholder suffix or prefix to a different value and you should be OK.

这篇关于如何忽略Flyway的占位符表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆