Skip to content
Snippets Groups Projects
Commit daaf047a authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1521 OZG-1995 mongock

parent 1f98ed6b
No related branches found
No related tags found
No related merge requests found
...@@ -179,7 +179,35 @@ ...@@ -179,7 +179,35 @@
<version>1.15.3</version> <version>1.15.3</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- mongock -->
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-springboot</artifactId>
<version>5.0.35</version>
</dependency>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-driver-core</artifactId>
<version>5.0.35</version>
</dependency>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongodb-springdata-v2-driver</artifactId>
<version>5.0.35</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-core-bom</artifactId>
<version>5.0.35</version>
<type>pom</type>
</dependency>
</dependencies> </dependencies>
</dependencyManagement>
<build> <build>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
......
...@@ -8,15 +8,17 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; ...@@ -8,15 +8,17 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import io.mongock.runner.springboot.EnableMongock;
@SpringBootApplication(scanBasePackages = "de.itvsh.*") @SpringBootApplication(scanBasePackages = "de.itvsh.*")
@EnableAsync @EnableAsync
@EnableScheduling @EnableScheduling
@EnableAspectJAutoProxy(proxyTargetClass = true) @EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableMongock
public class PlutoServerApplication { public class PlutoServerApplication {
public static void main(String[] args) { public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
SpringApplication.run(PlutoServerApplication.class, args); SpringApplication.run(PlutoServerApplication.class, args);
} }
} }
\ No newline at end of file
package de.itvsh.ozg.pluto.migration;
import io.mongock.api.annotations.ChangeUnit;
import io.mongock.api.annotations.Execution;
import io.mongock.api.annotations.RollbackExecution;
@ChangeUnit(id = "2022-01-21", order = "1", author = "mongock")
public class TestCreateCollection {
@Execution
public void changeSet() {
System.out.println("Execution");
}
@RollbackExecution
public void doSomething() {
System.out.println("Rollback");
}
}
\ No newline at end of file
...@@ -9,10 +9,18 @@ server: ...@@ -9,10 +9,18 @@ server:
management: management:
server.port: 8083 server.port: 8083
mongock:
runner-type: initializingbean
change-logs-scan-package:
- de.itvsh.ozg.pluto.migration
enabled: true
spring: spring:
data: data:
mongodb: mongodb:
database: pluto-local database: pluto-local
#nur zum localen testen(sollte aus dem rancher gezogen werden)
uri: mongodb://localhost:27018/test
mail: mail:
username: ea@ozg-sh.de username: ea@ozg-sh.de
password: skdljf39jx password: skdljf39jx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment