Skip to content

Audit schema migration: register handler and cast HasDetails varchar->boolean#7669

Open
labkey-martyp wants to merge 2 commits into
release26.3-SNAPSHOTfrom
26.3_fb_snprc_pg_data_migration_fixes
Open

Audit schema migration: register handler and cast HasDetails varchar->boolean#7669
labkey-martyp wants to merge 2 commits into
release26.3-SNAPSHOTfrom
26.3_fb_snprc_pg_data_migration_fixes

Conversation

@labkey-martyp
Copy link
Copy Markdown
Contributor

@labkey-martyp labkey-martyp commented May 14, 2026

Rationale

Audit tables need to flow through the SQL Server -> Postgres data migration. The
DatasetAuditDomain.HasDetails column is varchar in some legacy source databases
but boolean on the target. Without an explicit cast, the migration's INSERT
parameter inherits the source VARCHAR type and Postgres rejects the bound value
when writing to the target's boolean column.

Related Pull Requests

Changes

  • AuditModule.registerMigrationHandlers registers the audit schema with DatabaseMigrationService so all source rows are carried.
  • HasDetailsCastColumn (private static WrappedColumn) wraps the HasDetails column to emit CAST(... AS BIT) in the source SELECT and report JdbcType.BOOLEAN.

…ean cast

Audit tables are registered with DatabaseMigrationService so all source rows
flow through the migration. Wraps the DatasetAuditDomain "HasDetails" column
to CAST varchar source values to BIT and report JdbcType BOOLEAN, so the
INSERT parameter binds cleanly into the target's boolean column on PG.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant