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
Self-reference #59
Comments
Can you paste the part of your config you are working on, also what your tables configuration is, and what you are trying to achieve? |
Of course. I need to have categories, many of them with sub-categories. I'm doing this through a column called "parent" which basically has the ID of another category. If this column's value is 0 this category has no Parent. For the settings of this table as it is today, here goes:
|
I just came across this problem :( |
The query generated for the listview looks like this SELECT `tbl`.`id` AS __pk,`tbl`.`name`,
GROUP_CONCAT(DISTINCT CONCAT_WS(' ',CAST(`tbl`.`name` AS CHAR))) AS `parent`
FROM `tbl`
LEFT JOIN `tbl` ON `tbl`.`parent` = `tbl`.`id`
GROUP BY `tbl`.`id` ORDER BY `tbl`.`id` ASC LIMIT 0,25 ; but in case of a self reference, it should be transformed to this SELECT `tbl`.`id` AS __pk,`tbl`.`name`,
GROUP_CONCAT(DISTINCT CONCAT_WS(' ',CAST(`tbl2`.`name` AS CHAR))) AS `parent`
FROM `tbl`
LEFT JOIN `tbl` `tbl2` ON `tbl2`.`parent` = `tbl`.`id`
GROUP BY `tbl`.`id` ORDER BY `tbl`.`id` ASC LIMIT 0,25 ; the only difference is the alias I'll definitely think about it |
Trying to self-reference on a oneToMany relationship ("Parent" column) breaks the area with ER_NONUNIQ_TABLE.
The text was updated successfully, but these errors were encountered: