Skip to content

fix: Detect and sync missing columns even when schema version is unchanged#990

Open
rubenvdlinde wants to merge 3 commits intodevelopmentfrom
fix/schema-drift-sync
Open

fix: Detect and sync missing columns even when schema version is unchanged#990
rubenvdlinde wants to merge 3 commits intodevelopmentfrom
fix/schema-drift-sync

Conversation

@rubenvdlinde
Copy link
Contributor

@rubenvdlinde rubenvdlinde commented Mar 24, 2026

Summary

  • ensureTableForRegisterSchema previously skipped sync when the stored schema version hash matched
  • If columns were added to a schema after the version was stored (without a full sync), the table would permanently miss those columns
  • Now performs a fast sanity check: compares required columns from buildTableColumnsFromSchema against actual table columns from getExistingTableColumns
  • If any columns are missing, forces a sync regardless of the version hash

Root cause

The Procest case schema (204) had workflowTemplate and workflowVersion properties added after the magic table was created. The version hash was stored as "current" without the columns being created, so subsequent ensureTable calls saw no change and skipped sync.

Test plan

  • Verify Tags sidebar tab works on Procest case objects (PATCH with {tags: [...]} no longer 500s)
  • Verify sync adds missing columns automatically on next table access
  • Verify existing tables with all columns present are not unnecessarily synced

Closes #974

…anged

ensureTableForRegisterSchema previously skipped sync when the stored
schema version matched. If columns were added to a schema after the
version was stored (without a proper sync), the table would be missing
columns indefinitely.

Now performs a fast sanity check comparing required columns against
actual table columns. If any are missing, forces a sync regardless
of the version hash.

Closes #974
@github-actions
Copy link
Contributor

Quality Report

Repository ConductionNL/openregister
Commit 1ede38e
Branch 990/merge
Event pull_request
Generated 2026-03-24 13:15 UTC
Workflow Run https://github.com/ConductionNL/openregister/actions/runs/23491246252

Summary

Group Result
PHP Quality FAIL
Vue Quality PASS
Security PASS
License PASS
PHPUnit SKIP
Newman SKIP
Playwright SKIP

PHP Quality

Tool Result
lint PASS
phpcs FAIL
phpmd PASS
psalm PASS
phpstan PASS
phpmetrics PASS

Vue Quality

Tool Result
eslint PASS
stylelint PASS

Security

Ecosystem Result
composer PASS
npm PASS

License Compliance

Ecosystem Result
composer PASS
npm PASS

composer dependencies (147 total)

Metric Count
Approved (allowlist) 146
Approved (override) 1
Denied 0

npm dependencies (586 total)

Metric Count
Approved (allowlist) 585
Approved (override) 1
Denied 0

PHPUnit Tests

PHPUnit tests were not enabled for this run.

Integration Tests (Newman)

Newman integration tests were not enabled for this run.

E2E Tests (Playwright)

Playwright E2E tests were not enabled for this run.


Generated automatically by the Quality workflow.

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Contributor

Quality Report

Repository ConductionNL/openregister
Commit 3d281fd
Branch 990/merge
Event pull_request
Generated 2026-03-25 12:43 UTC
Workflow Run https://github.com/ConductionNL/openregister/actions/runs/23541517714

Summary

Group Result
PHP Quality FAIL
Vue Quality PASS
Security PASS
License PASS
PHPUnit SKIP
Newman SKIP
Playwright SKIP

PHP Quality

Tool Result
lint PASS
phpcs FAIL
phpmd PASS
psalm PASS
phpstan PASS
phpmetrics PASS

Vue Quality

Tool Result
eslint PASS
stylelint PASS

Security

Ecosystem Result
composer PASS
npm PASS

License Compliance

Ecosystem Result
composer PASS
npm PASS

composer dependencies (147 total)

Metric Count
Approved (allowlist) 146
Approved (override) 1
Denied 0

npm dependencies (595 total)

Metric Count
Approved (allowlist) 592
Approved (override) 3
Denied 0

PHPUnit Tests

PHPUnit tests were not enabled for this run.

Integration Tests (Newman)

Newman integration tests were not enabled for this run.

E2E Tests (Playwright)

Playwright E2E tests were not enabled for this run.


Generated automatically by the Quality workflow.

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Contributor

Quality Report

Repository ConductionNL/openregister
Commit 65ed181
Branch 990/merge
Event pull_request
Generated 2026-03-25 15:30 UTC
Workflow Run https://github.com/ConductionNL/openregister/actions/runs/23549204801

Summary

Group Result
PHP Quality PASS
Vue Quality PASS
Security PASS
License PASS
PHPUnit SKIP
Newman SKIP
Playwright SKIP

PHP Quality

Tool Result
lint PASS
phpcs PASS
phpmd PASS
psalm PASS
phpstan PASS
phpmetrics PASS

Vue Quality

Tool Result
eslint PASS
stylelint PASS

Security

Ecosystem Result
composer PASS
npm PASS

License Compliance

Ecosystem Result
composer PASS
npm PASS

composer dependencies (147 total)

Metric Count
Approved (allowlist) 146
Approved (override) 1
Denied 0

npm dependencies (595 total)

Metric Count
Approved (allowlist) 592
Approved (override) 3
Denied 0

PHPUnit Tests

PHPUnit tests were not enabled for this run.

Integration Tests (Newman)

Newman integration tests were not enabled for this run.

E2E Tests (Playwright)

Playwright E2E tests were not enabled for this run.


Generated automatically by the Quality workflow.

Download the full PDF report from the workflow artifacts.

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