mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-21 07:55:56 +08:00
fix: Throw ex on DDL fails
This commit is contained in:
parent
d77e0318a2
commit
452d0a034f
|
@ -94,7 +94,7 @@ public class Installer implements InstallAfter {
|
|||
}
|
||||
dbProps.putAll(cacheProps);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
FileUtils.deleteQuietly(dest);
|
||||
try (OutputStream os = new FileOutputStream(dest)) {
|
||||
|
|
|
@ -157,15 +157,15 @@ public class Entity2Schema extends Field2Schema {
|
|||
} catch (Throwable ex) {
|
||||
LOG.error(null, ex);
|
||||
Application.getCommonService().delete(tempMetaId.toArray(new ID[0]));
|
||||
return null;
|
||||
throw new ModifiyMetadataException("元数据初始化失败 : " + ex.getLocalizedMessage());
|
||||
}
|
||||
|
||||
boolean schemaReady = schema2Database(tempEntity);
|
||||
if (!schemaReady) {
|
||||
Application.getCommonService().delete(tempMetaId.toArray(new ID[0]));
|
||||
return null;
|
||||
throw new ModifiyMetadataException("无法创建表到数据库");
|
||||
}
|
||||
|
||||
|
||||
Application.getMetadataFactory().refresh(false);
|
||||
return entityName;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue