Skip to content

fix: manual admin tenant migration state recording#939

Merged
ferhatelmas merged 1 commit intomasterfrom
ferhat/admin-record-migration
Mar 27, 2026
Merged

fix: manual admin tenant migration state recording#939
ferhatelmas merged 1 commit intomasterfrom
ferhat/admin-record-migration

Conversation

@ferhatelmas
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Manual migration run via admin doesn't update tenant migration status in multitenant database.

What is the new behavior?

State is correctly updated.

Additional context

Extracted a helper for the same state updating query.

Copilot AI review requested due to automatic review settings March 27, 2026 12:03
@ferhatelmas ferhatelmas requested a review from a team as a code owner March 27, 2026 12:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes admin-triggered tenant migrations not recording migration completion state in the multitenant tenants table, bringing manual admin runs in line with other migration execution paths.

Changes:

  • Use updateTenantMigrationsState to consistently mark tenant migrations as COMPLETED after successful admin-initiated runs.
  • Extract a small helper (markTenantMigrationsCompleted) to deduplicate the state update logic across multiple admin tenant routes.
  • Add tests verifying that manual admin tenant migrations persist migrations_version/migrations_status, including when dbMigrationFreezeAt is configured.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/http/routes/admin/tenants.ts Ensures successful admin-triggered tenant migrations record completed migration state via shared helper.
src/test/admin-migrations.test.ts Adds regression tests asserting tenant migration state is recorded (normal + frozen target).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ferhatelmas ferhatelmas force-pushed the ferhat/admin-record-migration branch 2 times, most recently from 219c5de to 5e1d1bd Compare March 27, 2026 12:22
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
@ferhatelmas ferhatelmas force-pushed the ferhat/admin-record-migration branch from 5e1d1bd to ad26de0 Compare March 27, 2026 13:27
@ferhatelmas ferhatelmas merged commit b0cde79 into master Mar 27, 2026
3 checks passed
@ferhatelmas ferhatelmas deleted the ferhat/admin-record-migration branch March 27, 2026 13:41
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