Skip to content

Commit

Permalink
create tags table update
Browse files Browse the repository at this point in the history
  • Loading branch information
hpiwowar committed Sep 25, 2015
1 parent e7cd22e commit c1b0c82
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sql/create_tags_table.sql
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

0 comments on commit c1b0c82

Please sign in to comment.