Skip to content

DDL - DB Migration for History - change treatment of dropped columns such that they are still included in apply script #556

@rbygrave

Description

@rbygrave

So currently the DDL changes when a column is dropped from a @history table is that the history trigger and view is changed such that it excludes the column that is being dropped. However, the dropped column is only dropped when the drop script is run and that could be a significant time delay for that (days, weeks).

The change here is such that:

  • All "add column" (and "include column") changes to go into the 'apply' script.
  • All "drop column" (and "exclude column") changes to go into the 'drop' script.
  • The opposite of the 'apply' script is put into the 'rollback' script.

Scenarios:
A column is added:

  • apply trigger has the added column (rollback script reverts that)
  • drop script has no change included

A column is dropped:

  • apply script has no change included
  • drop script has the trigger changed for dropped column

A column is added and another column dropped:

  • this is just a combination of the above such that ...
  • apply trigger has the added column and still includes the column that will be dropped
  • drop script trigger has the dropped column removed but includes the added column

So in summary, changes to the history triggers and views are:

  • apply script includes added columns (and also columns that are being dropped)
  • drop script includes added columns and dropped columns are not included in the triggers/views

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions