Migliorati controlli per creazione query update
This commit is contained in:
@@ -3,6 +3,8 @@ package it.integry.ems.utility;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class UtilityDebug {
|
||||
|
||||
private static final String INTEGRY_DOMAIN = "STUDIO-ML";
|
||||
@@ -22,5 +24,17 @@ public class UtilityDebug {
|
||||
settingsModel.getDefaultProfile().equalsIgnoreCase("STUDIO-ML");
|
||||
}
|
||||
|
||||
public static boolean isIntegryServerDev() {
|
||||
String computerName = getComputerName();
|
||||
|
||||
return computerName.equalsIgnoreCase("SERVERDEV");
|
||||
}
|
||||
|
||||
private static String getComputerName() {
|
||||
Map<String, String> env = System.getenv();
|
||||
if (env.containsKey("COMPUTERNAME")) return env.get("COMPUTERNAME");
|
||||
else return env.getOrDefault("HOSTNAME", "Unknown Computer");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ public class SystemMigrationController {
|
||||
if (!UtilityDebug.isDebugExecution())
|
||||
throw new Exception("Puoi eseguire questa procedura solo in ambiente DEBUG!");
|
||||
|
||||
if (UtilityDebug.isIntegryServerDev())
|
||||
throw new Exception("Non puoi eseguire questa azione su SERVERDEV!");
|
||||
|
||||
final String[] split = objectsToCreate.split("\\|");
|
||||
|
||||
final List<SqlObjectDTO> querySyntaxFromExistingObjects = systemMigrationService.createQuerySyntaxFromExistingObjects(split);
|
||||
|
||||
@@ -92,7 +92,6 @@ public class SystemMigrationService {
|
||||
"\n" +
|
||||
"\n");
|
||||
|
||||
//HERE
|
||||
for (SqlObjectDTO sqlObject : sqlObjects) {
|
||||
|
||||
String typeName = sqlObject.getType().toString().toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user