我正在使用带有gradle的flyway,我在数据库控制台中手动运行了一个迁移,我想运行flyway,但是要告诉它忽略所有其他迁移版本.可以这样做吗?
我在 PostgreSQL 中有一个简单的查询,当我在没有任何查询参数的情况下运行它时,这是可以的:
select date_trunc('week', action_time),count(*) from event
group by date_trunc('week', action_time);
Run Code Online (Sandbox Code Playgroud)
但是如果我尝试将“周”作为参数发送,如下所示(在 Java 中):
PreparedStatement statement = connection.prepareStatement
("select date_trunc(?, action_time),count(*) from event"
+ " group by date_trunc(?, action_time)");
statement.setString(1,"week");
statement.setString(2,"week");
statement.execute();
Run Code Online (Sandbox Code Playgroud)
它会抛出以下错误:
ERROR: column "event.action_time" must appear in the GROUP BY clause or
be used in an aggregate function
Run Code Online (Sandbox Code Playgroud)
这是正常行为吗?