mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 08:58:26 +00:00
fix(upgrade): Check whether tables exist using findList (#3229)
This commit is contained in:
parent
2de4ea9566
commit
05a7939c3a
@ -5,6 +5,7 @@ import com.linkedin.metadata.entity.ebean.EbeanAspectV2;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.SqlQuery;
|
||||
import io.ebean.SqlRow;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AspectStorageValidationUtil {
|
||||
@ -27,8 +28,8 @@ public class AspectStorageValidationUtil {
|
||||
+ "WHERE TABLE_NAME = 'metadata_aspect_v2'";
|
||||
|
||||
final SqlQuery query = server.createSqlQuery(queryStr);
|
||||
SqlRow row = query.findOne();
|
||||
return row != null;
|
||||
final List<SqlRow> rows = query.findList();
|
||||
return rows.size() > 0;
|
||||
}
|
||||
|
||||
public static boolean checkV1TableExists(EbeanServer server) {
|
||||
@ -37,7 +38,7 @@ public class AspectStorageValidationUtil {
|
||||
+ "WHERE TABLE_NAME = 'metadata_aspect'";
|
||||
|
||||
final SqlQuery query = server.createSqlQuery(queryStr);
|
||||
SqlRow row = query.findOne();
|
||||
return row != null;
|
||||
final List<SqlRow> rows = query.findList();
|
||||
return rows.size() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user