Improve SQL Server migration process #7292
Open
+1,102
−908
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
We need to lowercase all ENTITYIDs during SQL Server migration. Also need to address a few issues and complications introduced by the cloning migration work and other recent changes.
Fix a variety of
SimpleFilterissues uncovered during the cloning migration work. Add regression tests for these issues.IN (NULL)has been used in various places as a substitute forFALSE. This construct is problematic becauseNULLis considered an unknown value in SQL, which meansIN (NULL)evaluates to FALSE butNOT IN (NULL)also evaluates to FALSE, which can lead to surprising results. For example, in LabKey,new InClause(fk, emptyList)selects no rows andnew NotClause(new InClause(fk, emptyList))also selects no rows.SQL Server Migration Changes
DatabaseMigrationConfiguration.getColumnNameFilter(); each configuration'sgetTableSelector()method can filter columns, if needed.AttachmentParentTypes. RecognizeImagedata type as a large binary type.core.PortalWebparts(GUID values are embedded in webpart properties) andcomm.Announcements(GUID values can be used as DiscussionSrcIdentifiers).PostgreSQL Dialect and
SimpleFilter.FilterClauseChangesBasePostgreSqlDialectis common to Redshift and PostgreSQL; move PostgreSQL-specific methods from BasePostgreSqlDialect toPostgreSql92Dialect.SQLClause.equals()SqlDialect.testLikeOperator()when scopes with different dialects are present. All configured scopes are tested, but the debug string used by the test was always generated assuming the LabKey scope.IN (NULL)to representFALSEwith0 = 1