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

Make license endpoint return number of nodes in existing orgs #444

Merged
merged 1 commit into from
Aug 12, 2015

Conversation

jeremiahsnapp
Copy link
Contributor

@stevendanna This fixes #437.

@@ -20,7 +20,7 @@
{ping, <<"SELECT 'pong' as ping LIMIT 1">>}.

%% Query to count the number of nodes for license checks
{count_nodes, <<"SELECT COUNT(*) as count FROM nodes">>}.
{count_nodes, <<"SELECT COUNT(*) as count FROM nodes as n LEFT JOIN orgs as o ON n.org_id = o.id WHERE o.id IS NOT NULL;">>}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be clearer to SELECT COUNT(*) as count FROM nodes, orgs WHERE orgs.id = nodes.org_id?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alt if you wanna get all ANSI-compliant: SELECT COUNT(*) FROM nodes INNER JOIN orgs ON orgs.id = nodes.org_id

@jeremiahsnapp
Copy link
Contributor Author

Thanks @marcparadise for hitting me in the head with the "obvious" stick. 😄

I updated the commit with your ANSI-compliant option.

@stevendanna
Copy link
Contributor

👍

@marcparadise
Copy link
Member

I'll merge once this passes: http://wilson.ci.chef.co/job/chef-server-12-build/1352

marcparadise added a commit that referenced this pull request Aug 12, 2015
Make license endpoint return number of nodes in existing orgs
@marcparadise marcparadise merged commit 4e28235 into master Aug 12, 2015
@marcparadise marcparadise deleted the jhs/fix_license_endpoint branch August 12, 2015 19:26
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

Successfully merging this pull request may close these issues.

license endpoint should return number of nodes in existing orgs
5 participants