Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations/Schema scanning does not take into account multiple connections #1577

Open
calebdw opened this issue Mar 6, 2023 · 1 comment · May be fixed by #1879
Open

Migrations/Schema scanning does not take into account multiple connections #1577

calebdw opened this issue Mar 6, 2023 · 1 comment · May be fixed by #1879
Labels
enhancement New feature or request

Comments

@calebdw
Copy link
Contributor

calebdw commented Mar 6, 2023

  • Larastan Version: 9.X
  • --level used: 1
  • Pull request with failing test:

Description

Hello!

It seems that Larastan does not respect multiple connections. I have two different connections (or databases) with a users table---their models have the $connection property in them so everything works.

However, when Larastan is scanning the migrations/schemas for the table properties it just puts all of the tables into an array keyed by the table name so one of the tables is overwritten (and therefore Larastan is throwing undefined property errors for that model).

Laravel code where the issue was found

        if ($creating) {
            $this->tables[$tableName] = new SchemaTable($tableName);
        }
@szepeviktor
Copy link
Collaborator

Yes, you're right. Larastan supports 1 database.

@canvural canvural added the enhancement New feature or request label Mar 6, 2023
@calebdw calebdw linked a pull request Mar 12, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants