问题描述
我的项目中具有以下配置,但由于某些原因,更改日志从未执行。
关于我所缺少的任何想法吗?
我可以成功使用mongo客户端并执行CRUD操作,只是MongockStandalone无法正常工作。
pom.xml
<dependency>
<groupId>com.github.cloudyrock.mongock</groupId>
<artifactId>mongock-standalone</artifactId>
<version>4.1.14</version>
</dependency>
<dependency>
<groupId>com.github.cloudyrock.mongock</groupId>
<artifactId>mongodb-v3-driver</artifactId>
<version>4.1.14</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.11.0</version>
</dependency>
主类中的驱动程序代码:
MongockStandalone.builder()
.setDriver(MongoCore3Driver.withDefaultLock(mongoClient,"demo"))
.addChangeLogsScanPackage("co.my.test.persistence.changelog")
.buildrunner();
Changelog类:
package co.my.test.persistence.changelog;
//imports
@ChangeLog(order = "001")
public class Changelog001 {
@ChangeSet(order = "001",id = "test",author = "Igor Flakiewicz")
public void test() {
// this method is never executed,the sout doesn't occur and breakpoints are not reached
System.out.println("PLEASE WORK!");
// migration code
}
}
解决方法
可能您正在关注blur
。感谢这张票,我们已经在文档中发现了一个错误。
使用以下代码构建运行器之后:
export class SampleComponent {
focus = false; // <-- default value
...
}
您需要执行方法<div class="form__group__full">
<input (focus)="focus=true" (blur)="focus=false" type="text" class="form__field" id="callbackName" [(ngModel)]="name" placeholder="e.g. John"
[ngStyle]="focus ? {'color': brand?.colours.primary,'border-bottom': '2px solid ' + brand?.colours.secondary,'border-image:focus': 'linear-gradient(to right,' + brand?.colours.primary + ',' + brand?.colours.secondary + ')'} : ''"
>
<label for="callbackName" class="form__label">Name</label>
</div>
因此,您应该使用的正确代码如下:
MongockStandalone.builder()
.setDriver(MongoCore3Driver.withDefaultLock(mongoClient,"demo"))
.addChangeLogsScanPackage("co.my.test.persistence.changelog")
.buildRunner();