Skip to content

Remove SQL Server upgrade scripts and code - #307

Merged
labkey-jeckels merged 4 commits into
developfrom
fb_removeSqlServer2
Aug 24, 2026
Merged

Remove SQL Server upgrade scripts and code#307
labkey-jeckels merged 4 commits into
developfrom
fb_removeSqlServer2

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Aug 23, 2026

Copy link
Copy Markdown

Rationale

We no longer support SQLServer as a primary DB

Changes

  • Remove schema upgrade scripts
  • Remove SQLServer conditional code
  • Remove SupportedDatabases in module.properties
  • Remove uses of PostgresOnlyTest
  • Remove Naturalize CLR management and use as there are no known uses on external schemas/DBs

@labkey-jeckels
labkey-jeckels requested review from a team and bbimber August 23, 2026 16:35
@labkey-jeckels labkey-jeckels self-assigned this Aug 23, 2026
@labkey-jeckels

labkey-jeckels commented Aug 23, 2026

Copy link
Copy Markdown
Author

@bbimber most of this is straightforward and mechanical, but please see my notes about the CLR. No rush to review. I restored the "include" upon review since it was part of the index name (if not actually impacting the index itself on PG)

@labkey-martyp labkey-martyp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me. Just a couple small suggestions.

Not sure why we don't have EHR test check on the PRs in this repo.

@@ -536,54 +524,12 @@ public void exec(ResultSet object) throws SQLException

private void getDBSize(Container c, User u, final StringBuilder msg, final StringBuilder alerts, Map<String, String> saved, Map<String, String> toSave)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks like toSave parameter is no longer used.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Many unused parameters in this file. I pruned most and deleted some unused methods too. Don't want to go overboard on unrelated code cleanup.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I will make a note to look at this later. A lot of this code is quite old. if i had time some day i'd like to go through a cull a lot of things...

}

if (!ti.getSqlDialect().isPostgreSQL() && !ti.getSqlDialect().isSqlServer())
if (!ti.getSqlDialect().isPostgreSQL())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need this at all? Doesn't seem consistent with other table customizers.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it's extremely unlikely this would ever run on another external schema (mysql / oracle (if you support that anymore); however, it's it theoretically possible?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Probably not but it's possible this is configured against external DBs somewhere. I didn't want to chase that down so I left it in.


msg.append("<br><b>The top 20 largest tables, by row count:</b><br><br>");
msg.append("<table border=1 style='border-collapse: collapse;'><tr style='font-weight:bold;'><td>Schema</td><td>Table</td><td># of Rows</td><td>Previous Value</td><td>% Change</td></tr>");
msg.append("<br><b>The top 20 largest tables, by row count:</b><br><br>");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@labkey-jeckels : you do happen to know if any of the changes LK added to address the AI security review are in develop, or are they in a branch? I dont recall if they touched this, but they did touch a few places to convert string HTML into DOM(). I bring this up to head off merge conflicts

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We're continuing to do scans and address the findings based on severity and choose the appropriate branch for the fix. That said, we should be current here and avoid conflicts since we have the regularly weekly merges to pull all changes from release branches forward to develop.

@bbimber

bbimber commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

@bbimber most of this is straightforward and mechanical, but please see my notes about the CLR. No rush to review. I restored the "include" upon review since it was part of the index name (if not actually impacting the index itself on PG)

I saw that. These indexes are one very old feature that should be reviewed. I'm not sure I want to carry them forward into the postgres migration. PRIMe is where more of these things could potentially matter (a more DB-intensive application), then my other servers. Your changes are probably the right thing.

@labkey-jeckels

Copy link
Copy Markdown
Author

@bbimber most of this is straightforward and mechanical, but please see my notes about the CLR. No rush to review. I restored the "include" upon review since it was part of the index name (if not actually impacting the index itself on PG)

I saw that. These indexes are one very old feature that should be reviewed. I'm not sure I want to carry them forward into the postgres migration. PRIMe is where more of these things could potentially matter (a more DB-intensive application), then my other servers. Your changes are probably the right thing.

Thanks for taking a look. Yeah, I'd like to assess the indices based on real query perf in Postgres so I'm trying not to get too carried away with changes as part of bulk refactors like this one. A lot has changed since they were added.

@bbimber

bbimber commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

@labkey-jeckels, yes, most of the custom index stuff in LDK and EHR dates back to ~2013-2014-ish, when PRIMe was having substantial issues. With hindsight, I would address it differently, but some of those ideas are also non-trivial changes (like maintaining a cached table with some of the common values currently calculated on-the-fly in SQL). That's not something that can happen here.

@labkey-jeckels
labkey-jeckels merged commit af7edfa into develop Aug 24, 2026
6 of 7 checks passed
@labkey-jeckels
labkey-jeckels deleted the fb_removeSqlServer2 branch August 24, 2026 16:40
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