What is required for database "unpublish" template

In our current implementation, we have been creating the database publish template - with the XML for the source & full binding information - then making a copy to use for the database “unpublish” template. We only changing the binding $db.action from “r” (for the publish template) to “d” for the unpublish template. Historically, we have kept the “publish” and “unpublish” database templates in sync as we have added and removed fields.

Is this overkill? Is there a minimum amount of information that we could provide to the unpublish template?

I’m asking because we have added a new field to be published to the database. We have added it to the publish template and it’s working correctly. We have not added it to the unpublish template - and it’s also working correctly.

My thought is that you have to include the main table & child tables - and the primary index values for those tables - but that anything else is “extra”.

Any thoughts/experience with this?

What you are doing make sense because the delete SQL statement should look like: DELETE FROM <fully-qualified-table-name> WHERE <condition-of-the-target-row>

It does not need to specified the field names/values used for inserting/updating the row, unless the field names/values are used as part of the WHERE clause.

You should be able to see the actual SQL statement (publishing or unpublishing) by modify the log4j.xml. Note, turn on debug for the SQL statements is not recommend in production environment, but for debug / testing use only.

Thank you much for response.

I double-checked what was in the logs for the “unpublish” - and confirmed that only the primary keys to the tables were needed.

I removed any fields not in the primary keys from both the “bindings” tab and the “source” tab - and it ran successfully as expected.