[#344] rename initialization sql files (#8969)

This commit is contained in:
yjqg6666 2022-08-25 16:54:18 +08:00 committed by GitHub
parent f1c95a8fb4
commit cb3c78b93b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 3 deletions

View File

@ -94,12 +94,12 @@ public class LocalDataSourceServiceImpl implements DataSourceService {
throw new RuntimeException("datasource is null");
}
try {
execute(ds.getConnection(), "META-INF/schema.sql");
execute(ds.getConnection(), "META-INF/derby-schema.sql");
} catch (Exception e) {
if (LogUtil.DEFAULT_LOG.isErrorEnabled()) {
LogUtil.DEFAULT_LOG.error(e.getMessage(), e);
}
throw new NacosRuntimeException(NacosException.SERVER_ERROR, "load schema.sql error.", e);
throw new NacosRuntimeException(NacosException.SERVER_ERROR, "load derby-schema.sql error.", e);
}
}
@ -210,7 +210,7 @@ public class LocalDataSourceServiceImpl implements DataSourceService {
InputStream sqlFileIn = null;
try {
File file = new File(
EnvUtil.getNacosHome() + File.separator + "conf" + File.separator + "schema.sql");
EnvUtil.getNacosHome() + File.separator + "conf" + File.separator + "derby-schema.sql");
if (StringUtils.isBlank(EnvUtil.getNacosHome()) || !file.exists()) {
ClassLoader classLoader = getClass().getClassLoader();
URL url = classLoader.getResource(sqlFile);