File tree 1 file changed +11
-10
lines changed
src/main/java/no/nav/pto/veilarbportefolje/config
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -55,18 +55,19 @@ public PlatformTransactionManager transactionManager(DataSource dataSource) {
55
55
@ PostConstruct
56
56
@ SneakyThrows
57
57
public void migrateDb () {
58
- log .info ("Starting database migration..." );
59
58
DataSource dataSource = createDataSource (environmentProperties .getDbUrl ());
60
59
61
- Flyway .configure ()
62
- .validateMigrationNaming (true )
63
- .dataSource (dataSource )
64
- .locations ("db/postgres" )
65
- .baselineOnMigrate (true )
66
- .load ()
67
- .migrate ();
60
+ if (dataSource != null ) {
61
+ log .info ("Starting database migration..." );
62
+ Flyway .configure ()
63
+ .validateMigrationNaming (true )
64
+ .dataSource (dataSource )
65
+ .locations ("db/postgres" )
66
+ .baselineOnMigrate (true )
67
+ .load ()
68
+ .migrate ();
68
69
69
- assert dataSource != null ;
70
- dataSource . getConnection (). close ();
70
+ dataSource . getConnection (). close () ;
71
+ }
71
72
}
72
73
}
You can’t perform that action at this time.
0 commit comments