我正在使用flyway版本2.3,我有一个sql补丁,它将varchar插入到一个表中,该表具有Flyway视为占位符的字符序列.我想飞越忽略占位符并按原样运行脚本.
脚本文件是
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();
}
}
Run Code Online (Sandbox Code Playgroud)
小智 8
这可以通过在表达式中拆分$和{来完成:
insert into test_data (value) values ('$' || '{Email}')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3091 次 |
| 最近记录: |