Skip to content

Commit

Permalink
chore(sqlserver): simplify sql server statement syntax (#3116)
Browse files Browse the repository at this point in the history
by using ';' as any other RDBMS
  • Loading branch information
educhastenier authored Aug 26, 2024
1 parent c0eb4d3 commit ff115f2
Show file tree
Hide file tree
Showing 11 changed files with 534 additions and 1,095 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,3 @@ mysql.quartz.connection.jobstoredriver=org.quartz.impl.jdbcjobstore.StdJDBCDeleg
oracle.quartz.connection.jobstoredriver=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
postgres.quartz.connection.jobstoredriver=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
sqlserver.quartz.connection.jobstoredriver=org.quartz.impl.jdbcjobstore.MSSQLDelegate

# Sql Delimiters
h2.sql.delimiter=;
mysql.sql.delimiter=;
oracle.sql.delimiter=;
postgres.sql.delimiter=;
sqlserver.sql.delimiter=GO
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,10 @@ protected void executeSQLResource(final String sqlFile, boolean shouldContinueOn
populate.setContinueOnError(shouldContinueOnError);
populate.setIgnoreFailedDrops(true);
populate.addScript(sqlResource);
populate.setSeparator(getSeparator());
populate.execute(datasource);
log.info("Executed SQL script " + sqlResource.getURL().getFile());
}

private String getSeparator() {
if ("sqlserver".equals(dbVendor)) {
return "GO";
} else {
return ";";
}
}

public void initializePlatformStructure() throws PlatformException {
try {
executeSQLResources(Collections.singletonList("initTables.sql"), FAIL_ON_ERROR);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,119 +1,61 @@
DELETE FROM arch_contract_data
GO
DELETE FROM contract_data
GO
DELETE FROM actormember
GO
DELETE FROM actor
GO
DELETE FROM processcategorymapping
GO
DELETE FROM category
GO
DELETE FROM arch_process_comment
GO
DELETE FROM process_comment
GO
DELETE FROM process_definition
GO
DELETE FROM arch_document_mapping
GO
DELETE FROM document
GO
DELETE FROM document_mapping
GO
DELETE FROM arch_flownode_instance
GO
DELETE FROM arch_process_instance
GO
DELETE FROM arch_connector_instance
GO
DELETE FROM arch_multi_biz_data
GO
DELETE FROM arch_ref_biz_data_inst
GO
DELETE FROM multi_biz_data
GO
DELETE FROM ref_biz_data_inst
GO
DELETE FROM pending_mapping
GO
DELETE FROM message_instance
GO
DELETE FROM waiting_event
GO
DELETE FROM event_trigger_instance
GO
DELETE FROM connector_instance
GO
DELETE FROM flownode_instance
GO
DELETE FROM process_instance
GO
DELETE FROM processsupervisor
GO
DELETE FROM business_app_menu
GO
DELETE FROM business_app_page
GO
DELETE FROM business_app
GO
DELETE FROM command
GO
DELETE FROM arch_data_instance
GO
DELETE FROM data_instance
GO
DELETE FROM dependencymapping
GO
DELETE FROM dependency
GO
DELETE FROM external_identity_mapping
GO
DELETE FROM user_membership
GO
DELETE FROM custom_usr_inf_val
GO
DELETE FROM custom_usr_inf_def
GO
DELETE FROM user_contactinfo
GO
DELETE FROM user_login
GO
DELETE FROM user_
GO
DELETE FROM role
GO
DELETE FROM group_
GO
DELETE FROM queriablelog_p
GO
DELETE FROM queriable_log
GO
DELETE FROM page
GO
DELETE FROM sequence WHERE tenantId <> -1
GO
DELETE FROM profilemember
GO
DELETE FROM profile
GO
DELETE FROM job_log
GO
DELETE FROM job_param
GO
DELETE FROM job_desc
GO
DELETE FROM tenant
GO
DELETE FROM platformCommand
GO
DELETE FROM form_mapping
GO
DELETE FROM page_mapping
GO
DELETE FROM proc_parameter
GO
DELETE FROM arch_contract_data;
DELETE FROM contract_data;
DELETE FROM actormember;
DELETE FROM actor;
DELETE FROM processcategorymapping;
DELETE FROM category;
DELETE FROM arch_process_comment;
DELETE FROM process_comment;
DELETE FROM process_definition;
DELETE FROM arch_document_mapping;
DELETE FROM document;
DELETE FROM document_mapping;
DELETE FROM arch_flownode_instance;
DELETE FROM arch_process_instance;
DELETE FROM arch_connector_instance;
DELETE FROM arch_multi_biz_data;
DELETE FROM arch_ref_biz_data_inst;
DELETE FROM multi_biz_data;
DELETE FROM ref_biz_data_inst;
DELETE FROM pending_mapping;
DELETE FROM message_instance;
DELETE FROM waiting_event;
DELETE FROM event_trigger_instance;
DELETE FROM connector_instance;
DELETE FROM flownode_instance;
DELETE FROM process_instance;
DELETE FROM processsupervisor;
DELETE FROM business_app_menu;
DELETE FROM business_app_page;
DELETE FROM business_app;
DELETE FROM command;
DELETE FROM arch_data_instance;
DELETE FROM data_instance;
DELETE FROM dependencymapping;
DELETE FROM dependency;
DELETE FROM external_identity_mapping;
DELETE FROM user_membership;
DELETE FROM custom_usr_inf_val;
DELETE FROM custom_usr_inf_def;
DELETE FROM user_contactinfo;
DELETE FROM user_login;
DELETE FROM user_;
DELETE FROM role;
DELETE FROM group_;
DELETE FROM queriablelog_p;
DELETE FROM queriable_log;
DELETE FROM page;
DELETE FROM sequence WHERE tenantId <> -1;
DELETE FROM profilemember;
DELETE FROM profile;
DELETE FROM job_log;
DELETE FROM job_param;
DELETE FROM job_desc;
DELETE FROM tenant;
DELETE FROM platformCommand;
DELETE FROM form_mapping;
DELETE FROM page_mapping;
DELETE FROM proc_parameter;

-- do NOT clear directly PLATFORM table, Hibernate needs to update its cache to know the platform has been deleted

Loading

0 comments on commit ff115f2

Please sign in to comment.