Schema Change Tracking
Schema Changes Tracking mechanism in Dataedo detects changes to database schema (tables, columns, data types etc) at import time and stores it in history tables.
History tables
Changes are stored in history tables, one for each schema table. Each table has _changes postfix:
- tables -> tables_changes,
- columns -> columns_changes,
- etc.
Updates
Each row in history table represents one change detected at schema import operation from source database. Those import operations are stored in the schema_updates table. Each Import/Update operation is logged as one row and the type of the operation is stored in type column (IMPORT, UPDATE). All the changes from one import operation can be grouped with update_id column that is also primary key of schema_updates table.
Operation types
There are three types of change and row types in history tables and this information is stored in operation column:
- ADDED - object/element was added,
- UPDATED - object/element was updated,
- DELETED - object/element was deleted
Change time
There are two columns that you can use to find the time of the changes:
- valid_from - when change was detected in the repository
- valid_to - when next change of this object was detected
Please note that because import time can last significant amout of time times in differernt rows and tables from the same update may vary. You can also use update_id->schema_updates.datetime.
Attribute changes - before/after values
History tables hold details of changed object/element attributes, both after and before change values, like in the following example:
- After change: datatype
- Before change: before_datatype
Initial import
Initial database import is not logged in schema change tables.
Name | Type | Status | ||
---|---|---|---|---|
1 | dbo.columns_changes | Change Tracking | Active | |
2 | dbo.parameters_changes | Change Tracking | Active | |
3 | dbo.procedures_changes | Change Tracking | Active | |
4 | dbo.schema_updates (Imports/Updates) | Metadata | Active | |
5 | dbo.tables_changes | Change Tracking | Active | |
6 | dbo.tables_relations_changes | Change Tracking | Active | |
7 | dbo.tables_relations_columns_changes | Change Tracking | Active | |
8 | dbo.triggers_changes | Change Tracking | Active | |
9 | dbo.unique_constraints_changes | Change Tracking | Active | |
10 | dbo.unique_constraints_columns_changes | Change Tracking | Active |