teamtnt / laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
MIT License
1.1k stars 142 forks source link

ERROR: column "__soft_deleted" does not exist when 'soft_delete' => true in scout config #318

Closed phanan closed 3 years ago

phanan commented 3 years ago

(This might very well be related to #184, but since the latter is 2 years old, I don't want to revive it.)

Basically with this setup:

A search would result in an "undefined column" error e.g.,

 [2021-04-27 12:14:04] local.ERROR: 192.168.10.1 - 43ce52b1-7c08-4837-a5be-08eb717d66b4 2021-04-27T12:14:04.    739131Z GET /admin/companies/search?term=foo&_type=query&q=foo HTTP/2.0 - - {"message":"SQLSTATE[42703]:       Undefined column: 7 ERROR:  column \"__soft_deleted\" does not exist
 LINE 1: select * from \"companies\" where \"__soft_deleted\" = $1 and \"c...
                                         ^ (SQL: select * from \"companies\" where \"__soft_deleted\" = 0 and   \"companies\".\"id\" in (73000167-f69f-4389-8150-c1ec9ba3ee17))"}

Is this a bug or just something I'm not aware of?

phanan commented 3 years ago

OK, I think I've figured it out. Will send a PR shortly.