You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
status: awaiting responseFor issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no actiontype: bugDEPRECATED: replace with the "bug" issue type
Update: I didn't mention I have underscored: true option in models
What do you expect to happen?
We want to get a number!
What is actually happening?
But we get error: column images.imageableType does not exist
SQL: SELECT count("User"."id") AS "count" FROM "users" AS "User" LEFT OUTER JOIN "images" AS "images" ON "User"."id" = "images"."imageable_id" AND ("images"."imageableType" = 'user');
Actually, there should be "images"."imageable_type" = 'user'
SELECT count(*) AS `count` FROM `users` AS `User` LEFT OUTER JOIN `images` AS `image` ON `User`.`id` = `image`.`imageable_id` AND (`image`.`deleted_at` IS NULL AND `image`.`imageableType` = 'user') WHERE (`User`.`deleted_at` IS NULL);
As you can see there is still imageableType instead of imageable_type
status: awaiting responseFor issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no actiontype: bugDEPRECATED: replace with the "bug" issue type
Activity
mamogaaa commentedon Jul 11, 2019
Same problem
kaikash commentedon Jul 22, 2019
@sushantdhiman
papb commentedon Jul 22, 2019
Could you please test with another dialect, such as SQLite?
You can connect to an in-memory sqlite db by using
new Sequelize('sqlite::memory:').kaikash commentedon Jul 25, 2019
@papb I'm on vacation now, so I can't check it now.
I didn't mention I have
underscored: trueoption in modelspapb commentedon Jul 25, 2019
@kaikash No problem, take your time! @nordikafiles Can you help?
kaikash commentedon Jul 25, 2019
@papb when using SQLite it makes query like this:
SELECT count(*) AS `count` FROM `users` AS `User` LEFT OUTER JOIN `images` AS `image` ON `User`.`id` = `image`.`imageable_id` AND (`image`.`deleted_at` IS NULL AND `image`.`imageableType` = 'user') WHERE (`User`.`deleted_at` IS NULL);As you can see there is still
imageableTypeinstead ofimageable_typepapb commentedon Jul 25, 2019
Closing in favor of #11225.
When #11225 gets closed, if anyone thinks this particular issue is still an issue, please ping me.