File tree 1 file changed +3
-6
lines changed
dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1
1
package com .linkedin .metadata .dao ;
2
2
3
- import com .linkedin . util . FileUtil ;
3
+ import com .google . common . io . Resources ;
4
4
import io .ebean .EbeanServer ;
5
5
import io .ebean .SqlRow ;
6
- import java .io .File ;
7
6
import java .io .IOException ;
8
7
import java .io .InputStream ;
9
8
import java .nio .charset .StandardCharsets ;
10
- import java .nio .file .Files ;
11
9
import java .util .List ;
12
10
import java .util .Properties ;
13
11
import lombok .extern .slf4j .Slf4j ;
@@ -69,10 +67,9 @@ public void ensureSchemaUpToDate() {
69
67
70
68
for (MigrationInfo pendingMigration : pendingMigrations ) {
71
69
try {
72
- List < File > file = FileUtil . listFiles ( new File ( "." ),
73
- pathname -> pathname . getName (). equals ( pendingMigration .getScript ()));
70
+ String location = _flyway . getConfiguration (). getLocations ()[ 0 ]. getPath ();
71
+ String sql = Resources . toString ( Resources . getResource ( location + "/" + pendingMigration .getScript ()), StandardCharsets . UTF_8 );
74
72
75
- String sql = new String (Files .readAllBytes (file .get (0 ).toPath ()), StandardCharsets .UTF_8 );
76
73
List <String > highRiskSQL = detectPotentialHighRiskSQL (sql );
77
74
78
75
for (String statement : highRiskSQL ) {
You can’t perform that action at this time.
0 commit comments