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

Table prefix issue #44

Open
SabatinoMasala opened this issue Apr 4, 2020 · 1 comment
Open

Table prefix issue #44

SabatinoMasala opened this issue Apr 4, 2020 · 1 comment

Comments

@SabatinoMasala
Copy link

SabatinoMasala commented Apr 4, 2020

The table name returned by $model->getTable() is unprefixed, causing errors on the describe query if a table prefix is present.

$safeTableName = \DB::getQueryGrammar()->wrap($table);

This could be solved by adding the prefix manually:

$safeTableName = \DB::getQueryGrammar()->wrap($model->getConnection()->getTablePrefix() . $table);

I had this issue occur on an older Laravel version: 5.7

Not tested on anything newer.

@mtolhuys
Copy link
Owner

mtolhuys commented Apr 7, 2020

Hi @SabatinoMasala,

Thnx for the suggestion! I'll try it out in my environments and take it along with the next release.

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

No branches or pull requests

2 participants