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

Add ability to remove watchers #5

Open
ststeiger opened this issue May 8, 2023 · 0 comments
Open

Add ability to remove watchers #5

ststeiger opened this issue May 8, 2023 · 0 comments

Comments

@ststeiger
Copy link
Owner

Add ability to remove watchers:

;WITH CTE AS 
( 
	SELECT 
		 watchers.watchable_type 
		,watchers.id 
		 
		,users.login 
		,users.firstname 
		,users.lastname 
		,users.type 
		 
		,CASE users.status 
			WHEN 1 THEN 'Active' 
			WHEN 2 THEN 'Registered' 
			WHEN 3 THEN 'Locked' 
			WHEN 4 THEN 'Anonymous' 
			ELSE 'Unknown' 
		END AS user_status 
	FROM issues 

	LEFT JOIN watchers 
		ON watchers.watchable_id = issues.id 

	LEFT JOIN users 
		ON users.id = watchers."user_id" 

	WHERE issues.id = 3276 
) 
SELECT * FROM CTE 

-- DELETE FROM watchers WHERE watchers.id = 198 

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