Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -179,11 +179,18 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
|||||||
|
|
||||||
|
|
||||||
protected void createSetupQuery(String codQuery, String name, String query, boolean override) throws SQLException, IOException {
|
protected void createSetupQuery(String codQuery, String name, String query, boolean override) throws SQLException, IOException {
|
||||||
if(override)
|
boolean existQuery = false;
|
||||||
executeStatement(Query.format("DELETE FROM stb_gest_setup_query WHERE cod_query = %s", codQuery));
|
if(override) {
|
||||||
|
String sql = Query.format("SELECT cast(count(*) as bit) FROM stb_gest_setup_query WHERE cod_query = %s", codQuery);
|
||||||
|
existQuery = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(), sql);
|
||||||
|
}
|
||||||
|
|
||||||
executeStatement(Query.format("INSERT INTO stb_gest_setup_query (cod_query, query_default, description)"+
|
if ( existQuery )
|
||||||
" VALUES (%s, %s, %s);", codQuery, query, name));
|
executeStatement(Query.format("UPDATE stb_gest_setup_query SET query_default = %S, description = %S WHERE cod_query = %s ",
|
||||||
|
query, name, codQuery));
|
||||||
|
else
|
||||||
|
executeStatement(Query.format("INSERT INTO stb_gest_setup_query (cod_query, query_default, description)"+
|
||||||
|
" VALUES (%s, %s, %s);", codQuery, query, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean existsSetup(String gestName, String section, String keySection) throws SQLException, IOException {
|
protected boolean existsSetup(String gestName, String section, String keySection) throws SQLException, IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user