Skip to content

Add MigrateStatus command and corresponding tests#1460

Open
tizianozonta wants to merge 1 commit into
archtechx:3.xfrom
tizianozonta:3.x
Open

Add MigrateStatus command and corresponding tests#1460
tizianozonta wants to merge 1 commit into
archtechx:3.xfrom
tizianozonta:3.x

Conversation

@tizianozonta
Copy link
Copy Markdown

Adds a new Artisan command tenants:migrate-status that mirrors Laravel's built-in migrate:status, but runs against tenant databases. Useful for inspecting which migrations have already been applied (or are
still pending) for one or more tenants, without having to switch context manually.

Usage

All tenants

php artisan tenants:migrate-status

Specific tenant(s)

php artisan tenants:migrate-status --tenants=
php artisan tenants:migrate-status --tenants= --tenants=

For each tenant, the command prints a header line (Tenant: ) followed by the standard Laravel migration status table (Ran / Pending / Batch).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7e1d3f1-6673-4f46-b658-9a0fafa0ae2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stancl
Copy link
Copy Markdown
Member

stancl commented May 15, 2026

Is this not already achievable with the tenants:run command wrapper? And from what I can tell reading the code here this would list the status of all migrations for all tenants. These multi-tenant commands are meant to work with thousands of tenants and I'm not sure that'd be a useful output structure. If we added a dedicated command for this purpose we'd probably want some more compact or otherwise lower noise output.

@tizianozonta
Copy link
Copy Markdown
Author

You are right, running this command you get the same result:

php artisan tenants:run migrate:status
--option=path=/code/project//database/migrations/tenant
--option=realpath=1

it's only a shortcut.
I can implement your suggestion if you want and provide a command that highlights only "problematic" migrations on each tenant.

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.

2 participants