Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ODS-6580] Replace Change Queries' AFTER UPDATE trigger with NHibernate interceptor #1217

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Copy link
Contributor

@axelmarquezh axelmarquezh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find Postman tests that cover the next scenarios:

  • Changes to root and non-root entities (independently) still result in ChangeVersion value updates.
  • Changes to a resource’s primary key values (using one of those that allows it), updates the ChangeVersion and LastModifiedDate of dependent resources, including coverage of resources impacted directly (foreign key is to root entity) and indirectly (foreign key is to a child entity).

if (sql.StartsWithCaseInsensitive(updateText))
{
// Add the ChangeVersion column update clause immediately after the SET keyword
SqlString updatedSql = sql.Insert(updateText.Length, _changeVersionSetClause);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails if I disable the ChangeQueries feature by following these instructions. The error message is: Invalid column name 'ChangeVersion'.

Consider checking if the feature is enabled.

…or SQL Server and PostgreSQL for Ed-Fi Standard 4.0.0 and 5.2.0.

Implemented support for SQL Server UPDATE statements to include NEXT VALUE FOR to assign ChangeVersion column value in lieu of server-side AFTER UPDATE trigger.

Modified test after expansion of values required for NHibernate interceptor configuration.

Post rebase fixes.

Namespace cleanup.

Added script to drop update triggers for SQL Server Standard v4.0.0 and v5.2.0.

Update triggers for SQL Server Standard v4.0.0 and v5.2.0 to not create a new change version for the tracked key change entry.

Add PostgreSQL migration scripts for v5.2 and v4.0 standards to remove update triggers for updating the changeversion.

Updated scripts for SQL Server and PostgreSQL for v4.0 and v5.2 to include a ChangeVersion sequence value update in the indirect cascade update triggers.

Modified interceptor logic to process queries for PostgreSQL as well as SQL Server.

Removed the CREATE TRIGGER statement from the change script since the trigger will already exist.

Update SQL Server change script for Homograph extension to use 'CREATE OR ALTER TRIGGER' since triggers will already exist.

Updated SQL interception behavior to use dialect (for SQL Server and PostgreSQL support).

Updated PostgreSQL migration scripts to remove the UpdateChangeVersion function using CASCADE keyword to eliminate all dependent triggers.

Fixed issue encountered when running NHibernate requests outside of regular APi request context.

Fixed ChangeVersion handling for derived resources.

Added feature check to SQL interception to prevent use of ChangeVersion when the feature is turned off.

SQL Server migration scripts accounting for cascading keys and volatile keys.

PostgreSQL Server migration scripts for Ed-Fi Standard 4.0.0  and 5.2.0 accounting for cascading keys and volatile keys.

Renamed PostgreSQL 5.2.0 file to match name of 4.0.0. file.

SQL Server migration scripts for Ed-Fi Standard 4.0.0  and 5.2.0 accounting for cascading keys and volatile keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants