Skip to content

Commit

Permalink
Merge branch 'release/v0.13.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Nov 26, 2024
2 parents 7220df4 + d1cfad1 commit 113ba91
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 32 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[0.13.2]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.2) - 2024-11-26
### Added
- [656](https://github.com/thoth-pub/thoth/pull/656) - Add database indexes to common attributes to improve performance

## [[0.13.1]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.1) - 2024-11-25
### Added
- [593](https://github.com/thoth-pub/thoth/issues/593) - Log GraphQL queries alongside request logs
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth"
version = "0.13.1"
version = "0.13.2"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -15,11 +15,11 @@ maintenance = { status = "actively-developed" }
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]

[dependencies]
thoth-api = { version = "=0.13.1", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "=0.13.1", path = "thoth-api-server" }
thoth-app-server = { version = "=0.13.1", path = "thoth-app-server" }
thoth-errors = { version = "=0.13.1", path = "thoth-errors" }
thoth-export-server = { version = "=0.13.1", path = "thoth-export-server" }
thoth-api = { version = "=0.13.2", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "=0.13.2", path = "thoth-api-server" }
thoth-app-server = { version = "=0.13.2", path = "thoth-app-server" }
thoth-errors = { version = "=0.13.2", path = "thoth-errors" }
thoth-export-server = { version = "=0.13.2", path = "thoth-export-server" }
clap = { version = "4.5.16", features = ["cargo", "env"] }
dialoguer = { version = "0.11.0", features = ["password"] }
dotenv = "0.15.0"
Expand Down
6 changes: 3 additions & 3 deletions thoth-api-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api-server"
version = "0.13.1"
version = "0.13.2"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
readme = "README.md"

[dependencies]
thoth-api = { version = "=0.13.1", path = "../thoth-api", features = ["backend"] }
thoth-errors = { version = "=0.13.1", path = "../thoth-errors" }
thoth-api = { version = "=0.13.2", path = "../thoth-api", features = ["backend"] }
thoth-errors = { version = "=0.13.2", path = "../thoth-errors" }
actix-web = "4.9"
actix-cors = "0.7.0"
actix-http = "3.9.0"
Expand Down
4 changes: 2 additions & 2 deletions thoth-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api"
version = "0.13.1"
version = "0.13.2"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -15,7 +15,7 @@ maintenance = { status = "actively-developed" }
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web", "jsonwebtoken", "deadpool-redis"]

[dependencies]
thoth-errors = { version = "=0.13.1", path = "../thoth-errors" }
thoth-errors = { version = "=0.13.2", path = "../thoth-errors" }
actix-web = { version = "4.8", optional = true }
argon2rs = "0.2.5"
isbn2 = "0.4.0"
Expand Down
100 changes: 100 additions & 0 deletions thoth-api/migrations/v0.13.1/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
-- Remove indexes from account table
DROP INDEX IF EXISTS idx_account_email;

-- Remove indexes from publisher_account table
DROP INDEX IF EXISTS idx_publisher_account_account_id;

-- Remove indexes from work table
DROP INDEX IF EXISTS idx_work_doi;
DROP INDEX IF EXISTS idx_work_reference;
DROP INDEX IF EXISTS idx_work_short_abstract_substr;
DROP INDEX IF EXISTS idx_work_long_abstract_substr;
DROP INDEX IF EXISTS idx_work_landing_page;
DROP INDEX IF EXISTS idx_work_imprint_id;
DROP INDEX IF EXISTS idx_work_updated_at_with_relations_desc;
DROP INDEX IF EXISTS idx_work_full_title_asc;
DROP INDEX IF EXISTS idx_work_publication_date_asc;
DROP INDEX IF EXISTS idx_work_publication_date_desc;
DROP INDEX IF EXISTS idx_work_type_status_pub_date_desc;
DROP INDEX IF EXISTS idx_work_books_pub_date_desc;

-- Remove indexes from work_relation table
DROP INDEX IF EXISTS idx_work_relation_relation_ordinal_relator_relation_type_asc;
DROP INDEX IF EXISTS idx_work_relation_relation_ordinal_related_relation_type_asc;

-- Remove indexes from publisher table
DROP INDEX IF EXISTS idx_publisher_publisher_name;
DROP INDEX IF EXISTS idx_publisher_publisher_shortname;

-- Remove indexes from imprint table
DROP INDEX IF EXISTS idx_imprint_imprint_name;
DROP INDEX IF EXISTS idx_imprint_imprint_url;
DROP INDEX IF EXISTS idx_imprint_publisher_id;

-- Remove indexes from subject table
DROP INDEX IF EXISTS idx_subject_subject_code_asc;
DROP INDEX IF EXISTS idx_subject_subject_ordinal_asc;

-- Remove indexes from publication table
DROP INDEX IF EXISTS idx_publication_work_id;
DROP INDEX IF EXISTS idx_publication_isbn;
DROP INDEX IF EXISTS idx_publication_publication_type;

-- Remove indexes from location table
DROP INDEX IF EXISTS idx_location_location_platform_asc;

-- Remove indexes from price table
DROP INDEX IF EXISTS idx_price_currency_code_asc;

-- Remove indexes from contributor table
DROP INDEX IF EXISTS idx_contributor_full_name;
DROP INDEX IF EXISTS idx_contributor_last_name;
DROP INDEX IF EXISTS idx_contributor_orcid;

-- Remove indexes from contribution table
DROP INDEX IF EXISTS idx_contribution_work_id;
DROP INDEX IF EXISTS idx_contribution_contributor_id;
DROP INDEX IF EXISTS idx_contribution_ordinal_asc;

-- Remove indexes from affiliation table
DROP INDEX IF EXISTS idx_affiliation_contribution_id;
DROP INDEX IF EXISTS idx_affiliation_ordinal_asc;

-- Remove indexes from institution table
DROP INDEX IF EXISTS idx_institution_institution_name;
DROP INDEX IF EXISTS idx_institution_ror;
DROP INDEX IF EXISTS idx_institution_institution_doi;

-- Remove indexes from funding table
DROP INDEX IF EXISTS idx_funding_work_id;
DROP INDEX IF EXISTS idx_funding_program;

-- Remove indexes from series table
DROP INDEX IF EXISTS idx_series_series_name;
DROP INDEX IF EXISTS idx_series_issn_print;
DROP INDEX IF EXISTS idx_series_issn_digital;
DROP INDEX IF EXISTS idx_series_series_url;
DROP INDEX IF EXISTS idx_series_series_description;
DROP INDEX IF EXISTS idx_series_imprint_id;

-- Remove indexes from issue table
DROP INDEX IF EXISTS idx_issue_ordinal_work_id_asc;
DROP INDEX IF EXISTS idx_issue_ordinal_series_id_asc;

-- Remove indexes from language table
DROP INDEX IF EXISTS idx_language_language_code_asc;

-- Remove indexes from reference table
DROP INDEX IF EXISTS idx_reference_work_id;
DROP INDEX IF EXISTS idx_reference_doi;
DROP INDEX IF EXISTS idx_reference_unstructured_citation;
DROP INDEX IF EXISTS idx_reference_issn;
DROP INDEX IF EXISTS idx_reference_isbn;
DROP INDEX IF EXISTS idx_reference_journal_title;
DROP INDEX IF EXISTS idx_reference_article_title;
DROP INDEX IF EXISTS idx_reference_series_title;
DROP INDEX IF EXISTS idx_reference_volume_title;
DROP INDEX IF EXISTS idx_reference_author_substr;
DROP INDEX IF EXISTS idx_reference_standard_designator;
DROP INDEX IF EXISTS idx_reference_standards_body_name;
DROP INDEX IF EXISTS idx_reference_standards_body_acronym;
105 changes: 105 additions & 0 deletions thoth-api/migrations/v0.13.1/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
-- Indexes account table
CREATE INDEX idx_account_email ON account (email);

-- Indexes publisher_account table
CREATE INDEX idx_publisher_account_account_id ON publisher_account (account_id);

-- Indexes work table
CREATE INDEX idx_work_doi ON work (doi);
CREATE INDEX idx_work_reference ON work (reference);
CREATE INDEX idx_work_short_abstract_substr ON work (substring(short_abstract FROM 1 FOR 255));
CREATE INDEX idx_work_long_abstract_substr ON work (substring(long_abstract FROM 1 FOR 255));
CREATE INDEX idx_work_landing_page ON work (landing_page);
CREATE INDEX idx_work_imprint_id ON work (imprint_id);
CREATE INDEX idx_work_updated_at_with_relations_desc ON work (updated_at_with_relations DESC, work_id);
CREATE INDEX idx_work_full_title_asc ON work (full_title ASC, work_id);
CREATE INDEX idx_work_publication_date_asc ON work (publication_date ASC, work_id);
CREATE INDEX idx_work_publication_date_desc ON work (publication_date DESC, work_id);
CREATE INDEX idx_work_type_status_pub_date_desc
ON work (work_type, work_status, publication_date DESC);
CREATE INDEX idx_work_books_pub_date_desc
ON work (publication_date DESC)
WHERE work_type IN ('monograph', 'edited-book', 'textbook') AND work_status = 'active';

-- Indexes work_relation table
CREATE INDEX idx_work_relation_relation_ordinal_relator_relation_type_asc
ON work_relation (relation_ordinal ASC, relator_work_id, relation_type);
CREATE INDEX idx_work_relation_relation_ordinal_related_relation_type_asc
ON work_relation (relation_ordinal ASC, related_work_id, relation_type);

-- Indexes publisher table
CREATE INDEX idx_publisher_publisher_name ON publisher (publisher_name);
CREATE INDEX idx_publisher_publisher_shortname ON publisher (publisher_shortname);

-- Indexes imprint table
CREATE INDEX idx_imprint_imprint_name ON imprint (imprint_name);
CREATE INDEX idx_imprint_imprint_url ON imprint (imprint_url);
CREATE INDEX idx_imprint_publisher_id ON imprint (publisher_id);

-- Indexes subject table
CREATE INDEX idx_subject_subject_code_asc ON subject (subject_code ASC, work_id);
CREATE INDEX idx_subject_subject_ordinal_asc ON subject (subject_ordinal ASC, work_id);

-- Indexes publication table
CREATE INDEX idx_publication_work_id ON publication (work_id);
CREATE INDEX idx_publication_isbn ON publication (isbn);
CREATE INDEX idx_publication_publication_type ON publication (publication_type);

-- Indexes location table
CREATE INDEX idx_location_location_platform_asc ON location (location_platform ASC, publication_id);

-- Indexes price table
CREATE INDEX idx_price_currency_code_asc ON price (currency_code ASC, publication_id);

-- Indexes contributor table
CREATE INDEX idx_contributor_full_name ON contributor (full_name);
CREATE INDEX idx_contributor_last_name ON contributor (last_name);
CREATE INDEX idx_contributor_orcid ON contributor (orcid);

-- Indexes contribution table
CREATE INDEX idx_contribution_work_id ON contribution (work_id);
CREATE INDEX idx_contribution_contributor_id ON contribution (contributor_id);
CREATE INDEX idx_contribution_ordinal_asc ON contribution (contribution_ordinal ASC, work_id);

-- Indexes affiliation table
CREATE INDEX idx_affiliation_contribution_id ON affiliation (contribution_id);
CREATE INDEX idx_affiliation_ordinal_asc ON affiliation (affiliation_ordinal ASC, contribution_id);

-- Indexes contributor table
CREATE INDEX idx_institution_institution_name ON institution (institution_name);
CREATE INDEX idx_institution_ror ON institution (ror);
CREATE INDEX idx_institution_institution_doi ON institution (institution_doi);

-- Indexes funding table
CREATE INDEX idx_funding_work_id ON funding (work_id);
CREATE INDEX idx_funding_program ON funding (program);

-- Indexes series table
CREATE INDEX idx_series_series_name ON series (series_name);
CREATE INDEX idx_series_issn_print ON series (issn_print);
CREATE INDEX idx_series_issn_digital ON series (issn_digital);
CREATE INDEX idx_series_series_url ON series (series_url);
CREATE INDEX idx_series_series_description ON series (series_description);
CREATE INDEX idx_series_imprint_id ON series (imprint_id);

-- Indexes issue table
CREATE INDEX idx_issue_ordinal_work_id_asc ON issue (issue_ordinal ASC, work_id);
CREATE INDEX idx_issue_ordinal_series_id_asc ON issue (issue_ordinal ASC, series_id);

-- Indexes language table
CREATE INDEX idx_language_language_code_asc ON language (language_code ASC, work_id);

-- Indexes reference table
CREATE INDEX idx_reference_work_id ON reference (work_id);
CREATE INDEX idx_reference_doi ON reference (doi);
CREATE INDEX idx_reference_unstructured_citation ON reference (unstructured_citation);
CREATE INDEX idx_reference_issn ON reference (issn);
CREATE INDEX idx_reference_isbn ON reference (isbn);
CREATE INDEX idx_reference_journal_title ON reference (journal_title);
CREATE INDEX idx_reference_article_title ON reference (article_title);
CREATE INDEX idx_reference_series_title ON reference (series_title);
CREATE INDEX idx_reference_volume_title ON reference (volume_title);
CREATE INDEX idx_reference_author_substr ON reference ((substring(author FROM 1 FOR 255)));
CREATE INDEX idx_reference_standard_designator ON reference (standard_designator);
CREATE INDEX idx_reference_standards_body_name ON reference (standards_body_name);
CREATE INDEX idx_reference_standards_body_acronym ON reference (standards_body_acronym);
2 changes: 1 addition & 1 deletion thoth-app-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-app-server"
version = "0.13.1"
version = "0.13.2"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions thoth-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-app"
version = "0.13.1"
version = "0.13.2"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down Expand Up @@ -35,8 +35,8 @@ uuid = { version = "1.10.0", features = ["serde", "v4"] }
# `getrandom` is a dependency of `uuid`, we need to explicitly import and include the `js` feature to enable wasm
# https://docs.rs/getrandom/latest/getrandom/#webassembly-support
getrandom = { version = "0.2", features = ["js"] }
thoth-api = { version = "=0.13.1", path = "../thoth-api" }
thoth-errors = { version = "=0.13.1", path = "../thoth-errors" }
thoth-api = { version = "=0.13.2", path = "../thoth-api" }
thoth-errors = { version = "=0.13.2", path = "../thoth-errors" }

[build-dependencies]
dotenv = "0.15.0"
Loading

0 comments on commit 113ba91

Please sign in to comment.