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

sql: Add support for releases published as part of a record #119

Merged
merged 2 commits into from
Jun 3, 2020

Conversation

Bjwebb
Copy link
Contributor

@Bjwebb Bjwebb commented May 21, 2020

Issue: #110

I have updated:

  • table tmp_release_summary to select the releases, which is then used by all the other create table statements
  • view parties_summary, to lookup the correct release from data.data (which stores the parent record)

The following always include data.data directly, even for a release type of record, so I haven't added a lookup for this new release type:

  • view tender_summary_with_data
  • view awards_summary
  • view contracts_summary
  • view release_summary_with_data

For the release_type I have used releases_within_record instead of releasesWithinRecord for consistency with compiled_release.

For the id, I have used: 1_000_000_000 * record.id + release_index. We may want to tweak this, or do something completely different. I have chosen the multiplier because its roughly the square root of the bigint maximum. Checking the kingfisher server, the largest record id is ~ 24_000_000, so I think this works for the foreseeable future (although that would be good to check with someone who knows the data better).

Releases are assumed to be linked releases (and ignored) if the id key is not present.

@Bjwebb Bjwebb requested review from kindly and a user May 21, 2020 14:44
@Bjwebb
Copy link
Contributor Author

Bjwebb commented May 21, 2020

* Add digit 3 to the end to disambiguate from other calculated release
  ids, including others we might add in the future.
* Reduce the multiplicative factor to 1000000, because the current
  maximum number of releases in a record is 363

#110
@Bjwebb Bjwebb merged commit 7f2a86f into master Jun 3, 2020
@Bjwebb Bjwebb deleted the 110-releasesWithinRecords branch June 3, 2020 11:55
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.

2 participants