-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
create table tags as | ||
select jsonb_array_elements_text(tags)::text as unique_tag, | ||
count(jsonb_array_elements_text(tags)::text) as count | ||
count(jsonb_array_elements_text(tags)::text) as count, | ||
host as namespace | ||
from package | ||
group by unique_tag | ||
group by unique_tag, host | ||
order by count desc | ||
|
||
alter table tags add column namespace text | ||
update tags set namespace='pypi' | ||
|
||
alter table tags add column id text | ||
update tags set id=(namespace||':'||unique_tag) | ||
|
||
select * from tags |