Comments (21)
Im sadly having the same issue, as Im also using MSSQL. Locking the version on 1.1.7 for now. If only I could use MySQL I would. 😢
@snazy2000 If you find a solution, please be so kind and post it here! 😅
from laravel-follow.
What db engine are you used?
from laravel-follow.
https://dev.mysql.com/doc/refman/8.0/en/working-with-null.html
IS NOT NULL
is a valid mysql syntax.
from laravel-follow.
from laravel-follow.
I got the reason. Sorry, I will fix that as soon as possible.
from laravel-follow.
@snazy2000 Plz take a try with master branch, plz let me know if it works.
from laravel-follow.
Hi @overtrue
I have just tried the fix and unfortunately still same error.
It doesn't look like what your doing there is supported in MSSQL
Stephen
from laravel-follow.
https://stackoverflow.com/questions/14962970/sql-query-if-value-is-null-then-return-1
from laravel-follow.
@snazy2000 Please paste the SQL.
from laravel-follow.
select [users].*, [pivot_followables].[user_id] IS NOT NULL as [pivot_each_other], [followables].[followable_id] as [pivot_followable_id], [followables].[user_id] as [pivot_user_id], [followables].[followable_type] as [pivot_followable_type], [followables].[relation] as [pivot_relation], [followables].[created_at] as [pivot_created_at] from [users] inner join [followables] on [users].[id] = [followables].[user_id] left join [followables] as [pivot_followables] on [pivot_followables].[followable_type] = 'App\Suggestion' and [pivot_followables].[followable_id] = [followables].[user_id] and [pivot_followables].[user_id] = [followables].[followable_id] where [followables].[followable_id] = 1066 and [followables].[followable_type] = App\Suggestion and [followables].[relation] = follow
from laravel-follow.
@snazy2000 I am sorry, I have not SQL Server environment, So, plz do you best to debug and fix this problem, or use MySQL. Let me know if you resolved the bug. Thanks.
from laravel-follow.
Can you advise what the need for the IS NOT NULL at that point?
If I remove it shows NULL in that field
Im used to the IS NOT NULL within the Where statements
from laravel-follow.
@snazy2000 #63 He want to get the follow each other state.
from laravel-follow.
@overtrue are you expecting this result
IF NOT NULL then set field = 1
IF NULL then set field = 0 ?
Or am I miss understanding?
from laravel-follow.
If the above is correct then this should work?
(CASE WHEN [pivot_followables].[user_id] IS NOT NULL THEN 1 ELSE 0 END) as [pivot_each_other],
from laravel-follow.
Yes, but is it compatible with MySQL?
from laravel-follow.
from laravel-follow.
from laravel-follow.
@snazy2000 plz take a try with master branch.
from laravel-follow.
No More errors! :) See query below
select [users].*, (CASE WHEN [pivot_followables].[user_id] IS NOT NULL THEN 1 ELSE 0 END) as [pivot_each_other], [followables].[followable_id] as [pivot_followable_id], [followables].[user_id] as [pivot_user_id], [followables].[followable_type] as [pivot_followable_type], [followables].[relation] as [pivot_relation], [followables].[created_at] as [pivot_created_at] from [users] inner join [followables] on [users].[id] = [followables].[user_id] left join [followables] as [pivot_followables] on [pivot_followables].[followable_type] = 'App\Suggestion' and [pivot_followables].[followable_id] = [followables].[user_id] and [pivot_followables].[user_id] = [followables].[followable_id] where [followables].[followable_id] = '1095' and [followables].[followable_type] = 'App\Suggestion' and [followables].[relation] = 'follow'
from laravel-follow.
😆
from laravel-follow.
Related Issues (20)
- Error Traits HOT 9
- Get List of Followings users HOT 1
- config key typo HOT 2
- Question: How to send notification/email to user when they have a new follower? HOT 11
- get General error: 1 no such table: followables error HOT 12
- $user->followings not working properly HOT 6
- how to recover data from the "following" user? HOT 2
- Feature Request: Followers you know HOT 9
- Extending the model
- Trait "Overtrue\LaravelFollow\Traits\Followable" not found HOT 2
- Update for Laravel 10
- [ERROR] After running command - SSL Issues HOT 3
- php artisan vendor:publish does not publish the migration or config HOT 3
- Error after upgrade to 5.1.0 HOT 14
- wrong sample code in readme.
- Can't Get Following Model Data HOT 1
- getting "general error" when attempting to use UUIDs HOT 2
- sorry. please delete this issue
- has_followed没有实现 HOT 2
- Unable to Handle UUIDs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-follow.