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

Rebuild doesn't check alias for parent_id #337

Closed
sahamilton opened this issue Jul 13, 2020 · 1 comment
Closed

Rebuild doesn't check alias for parent_id #337

sahamilton opened this issue Jul 13, 2020 · 1 comment

Comments

@sahamilton
Copy link

v2.x-dev Rebuild fails with message
Illuminate/Database/QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'persons.parent_id' in 'where clause' (SQL: select count(*) as aggregate from personsleft outer joinpersonsAS parent onpersons.parent_id = parent.id where (persons.lftIS NULL ORpersons.rgtIS NULL ORpersons.lft>=persons.rgt OR (persons.parent_id IS NOT NULL AND (persons.lft <= parent.lftORpersons.rgt >= parent.rgt))) and persons.deleted_at is null)'

where the model (in this casePerson) has an alias for the parent column:
protected $parentColumn = 'reports_to';

@sahamilton
Copy link
Author

OK My bad ... Looks like the parent column name has changed to parentColumnName vs parentColumn in prior version...

This issue was closed.
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

1 participant