Skip to content

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Dec 24, 2025

Github epic

Rationale

We need to lowercase all ENTITYIDs during SQL Server migration. We also need to address a few issues and complications introduced by the cloning migration work and other recent changes.

Fix a variety of SimpleFilter issues uncovered during the cloning migration work. Add regression tests for these issues.

IN (NULL) has been used in various places as a substitute for FALSE. This construct is problematic because NULL is considered an unknown value in SQL, which means IN (NULL) evaluates to FALSE but NOT IN (NULL) also evaluates to FALSE, which can lead to surprising results. For example, in LabKey, new InClause(fk, emptyList) selects no rows and new NotClause(new InClause(fk, emptyList)) also selects no rows.

SQL Server Migration Changes

  • Eliminate DatabaseMigrationConfiguration.getColumnNameFilter(); each configuration's getTableSelector() method can filter columns, if needed.
  • Bootstrap Users and Guests groups during bootstrap. Delete them before migration.
  • Rework attachment copying to simplify the SQL Server migration case: all rows are copied with no filtering and no need to enumerate or track AttachmentParentTypes. Recognize Image data type as a large binary type.
  • Provide a mechanism for schemas to map arbitrary GUID values that reside in non-GUID-typed columns to lowercase. Implement for core.PortalWebparts (GUID values are embedded in webpart properties) and comm.Announcements (GUID values can be used as DiscussionSrcIdentifiers).

PostgreSQL Dialect and SimpleFilter.FilterClause Changes

  • BasePostgreSqlDialect is common to Redshift and PostgreSQL; move PostgreSQL-specific methods from BasePostgreSqlDialect to PostgreSql92Dialect.
  • Fix completely broken SQLClause.equals()
  • Fix 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.
  • Replace use of IN (NULL) to represent FALSE with 0 = 1

Copy link
Contributor

@labkey-klum labkey-klum left a comment

Choose a reason for hiding this comment

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

looks good

@labkey-adam labkey-adam merged commit bd4eee1 into develop Dec 30, 2025
10 checks passed
@labkey-adam labkey-adam deleted the fb_sql_server_migration branch December 30, 2025 00:20
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.

3 participants