This is an automated email from the ASF dual-hosted git repository.

egonzalez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git


The following commit(s) were added to refs/heads/main by this push:
     new f689c4645 [incubator-kie-issues-2072] Add on cascade delete for few 
data-audit tables that have foreign key constraints
f689c4645 is described below

commit f689c46458b638d829572486787416f3b7c414fb
Author: Deepak Joseph <[email protected]>
AuthorDate: Fri Aug 22 15:31:41 2025 +0530

    [incubator-kie-issues-2072] Add on cascade delete for few data-audit tables 
that have foreign key constraints
---
 .../h2/V1.4.4__Add_on_cascade_delete.sql           | 27 ++++++++++++++++++++++
 .../postgresql/V1.4.4__Add_on_cascade_delete.sql   | 27 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git 
a/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/h2/V1.4.4__Add_on_cascade_delete.sql
 
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/h2/V1.4.4__Add_on_cascade_delete.sql
new file mode 100644
index 000000000..e1142c064
--- /dev/null
+++ 
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/h2/V1.4.4__Add_on_cascade_delete.sql
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+alter table process_instance_state_roles_log drop constraint 
fk_process_instance_state_pid;
+alter table process_instance_state_roles_log add constraint 
fk_process_instance_state_pid foreign key (process_instance_state_log_id) 
references process_instance_state_log on delete cascade;
+
+alter table task_instance_assignment_users_log drop constraint 
fk_task_instance_assignment_log_tid;
+alter table task_instance_assignment_users_log add constraint 
fk_task_instance_assignment_log_tid foreign key 
(task_instance_assignment_log_id) references task_instance_assignment_log on 
delete cascade;
+
+alter table task_instance_deadline_notification_log drop constraint 
fk_task_instance_deadline_tid;
+alter table task_instance_deadline_notification_log add constraint 
fk_task_instance_deadline_tid foreign key (task_instance_deadline_log_id) 
references task_instance_deadline_log on delete cascade;
diff --git 
a/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/postgresql/V1.4.4__Add_on_cascade_delete.sql
 
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/postgresql/V1.4.4__Add_on_cascade_delete.sql
new file mode 100644
index 000000000..e1142c064
--- /dev/null
+++ 
b/data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/kie-flyway/db/data-audit/postgresql/V1.4.4__Add_on_cascade_delete.sql
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+alter table process_instance_state_roles_log drop constraint 
fk_process_instance_state_pid;
+alter table process_instance_state_roles_log add constraint 
fk_process_instance_state_pid foreign key (process_instance_state_log_id) 
references process_instance_state_log on delete cascade;
+
+alter table task_instance_assignment_users_log drop constraint 
fk_task_instance_assignment_log_tid;
+alter table task_instance_assignment_users_log add constraint 
fk_task_instance_assignment_log_tid foreign key 
(task_instance_assignment_log_id) references task_instance_assignment_log on 
delete cascade;
+
+alter table task_instance_deadline_notification_log drop constraint 
fk_task_instance_deadline_tid;
+alter table task_instance_deadline_notification_log add constraint 
fk_task_instance_deadline_tid foreign key (task_instance_deadline_log_id) 
references task_instance_deadline_log on delete cascade;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to