Skip to content

Commit

Permalink
sql: Rename releases_within_records to embedded_release
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Jul 8, 2020
1 parent 328fdca commit 8acf888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sql/002-tmp_release_and_parties.sql
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ union

select
(r.id::bigint * 1000000 + (ordinality - 1)) * 10 + 3 AS id,
'releases_within_records' as release_type,
'embedded_release' as release_type,
r.id AS table_id,
collection_id,
ocid,
Expand Down Expand Up @@ -122,7 +122,7 @@ as
select
case
when release_type = 'record' then d.data -> 'compiledRelease'
when release_type = 'releases_within_records' then d.data -> 'releases' -> (mod(r.id / 10, 1000000)::integer)
when release_type = 'embedded_release' then d.data -> 'releases' -> (mod(r.id / 10, 1000000)::integer)
else d.data end AS data,
r.*
from
Expand Down Expand Up @@ -193,7 +193,7 @@ select
then
data #> ARRAY['compiledRelease', 'parties', party_index::text]
when
release_type = 'releases_within_records'
release_type = 'embedded_release'
then
data -> 'releases' -> (mod(parties_summary_no_data.id / 10, 1000000)::integer) -> 'parties' -> party_index::integer
else
Expand Down
2 changes: 1 addition & 1 deletion sql/999-docs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $$
template :=
$template$
Comment on column %%1$s.id IS 'Unique id representing a release, compiled_release or record' ;
Comment on column %%1$s.release_type IS 'Either release, compiled_release, record, releases_within_records. compiled_releases are releases generated by Kingfisher release compilation' ;
Comment on column %%1$s.release_type IS 'Either release, compiled_release, record, embedded_release. compiled_releases are releases generated by Kingfisher release compilation' ;
Comment on column %%1$s.collection_id IS 'id from Kingfisher collection table' ;
Comment on column %%1$s.ocid IS 'ocid from the data' ;
Comment on column %%1$s.release_id IS 'Release id from the data. Relevant for releases and not for compiled_releases or records' ;
Expand Down

0 comments on commit 8acf888

Please sign in to comment.