Skip to content

Commit 3a28358

Browse files
committed
Merge branch 'release/v0.12.4'
2 parents a494e74 + 0161672 commit 3a28358

13 files changed

Lines changed: 78 additions & 32 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [[0.12.4]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.4) - 2024-04-30
10+
### Changed
11+
- [545](https://github.com/thoth-pub/thoth/issues/545) - Add Zenodo as a location platform
12+
913
## [[0.12.3]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.3) - 2024-04-26
1014
### Added
1115
- [583](https://github.com/thoth-pub/thoth/issues/583) - Add new field, Permanently Withdrawn Date, to Work for Out-of-print or Withdrawn from Sale Works.

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth"
3-
version = "0.12.3"
3+
version = "0.12.4"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -16,11 +16,11 @@ maintenance = { status = "actively-developed" }
1616
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]
1717

1818
[dependencies]
19-
thoth-api = { version = "0.12.3", path = "thoth-api", features = ["backend"] }
20-
thoth-api-server = { version = "0.12.3", path = "thoth-api-server" }
21-
thoth-app-server = { version = "0.12.3", path = "thoth-app-server" }
22-
thoth-errors = { version = "0.12.3", path = "thoth-errors" }
23-
thoth-export-server = { version = "0.12.3", path = "thoth-export-server" }
19+
thoth-api = { version = "=0.12.4", path = "thoth-api", features = ["backend"] }
20+
thoth-api-server = { version = "=0.12.4", path = "thoth-api-server" }
21+
thoth-app-server = { version = "=0.12.4", path = "thoth-app-server" }
22+
thoth-errors = { version = "=0.12.4", path = "thoth-errors" }
23+
thoth-export-server = { version = "=0.12.4", path = "thoth-export-server" }
2424
clap = { version = "4.4.7", features = ["cargo", "env"] }
2525
dialoguer = { version = "0.11.0", features = ["password"] }
2626
dotenv = "0.15.0"

thoth-api-server/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api-server"
3-
version = "0.12.3"
3+
version = "0.12.4"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
99
readme = "README.md"
1010

1111
[dependencies]
12-
thoth-api = { version = "0.12.3", path = "../thoth-api", features = ["backend"] }
13-
thoth-errors = { version = "0.12.3", path = "../thoth-errors" }
12+
thoth-api = { version = "=0.12.4", path = "../thoth-api", features = ["backend"] }
13+
thoth-errors = { version = "=0.12.4", path = "../thoth-errors" }
1414
actix-web = "4.5.1"
1515
actix-cors = "0.7.0"
1616
actix-identity = "0.7.1"

thoth-api/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api"
3-
version = "0.12.3"
3+
version = "0.12.4"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -16,7 +16,7 @@ maintenance = { status = "actively-developed" }
1616
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web", "jsonwebtoken"]
1717

1818
[dependencies]
19-
thoth-errors = { version = "0.12.3", path = "../thoth-errors" }
19+
thoth-errors = { version = "=0.12.4", path = "../thoth-errors" }
2020
actix-web = { version = "4.5.1", optional = true }
2121
argon2rs = "0.2.5"
2222
isbn2 = "0.4.0"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
UPDATE location SET location_platform = 'Other' WHERE location_platform = 'Zenodo';
2+
3+
-- Drop the default and unique constraint, otherwise it won't be able to cast to text
4+
ALTER TABLE location ALTER COLUMN location_platform DROP DEFAULT;
5+
DROP INDEX location_uniq_platform_idx;
6+
7+
ALTER TABLE location ALTER COLUMN location_platform TYPE text;
8+
DROP TYPE location_platform;
9+
CREATE TYPE location_platform AS ENUM (
10+
'Project MUSE',
11+
'OAPEN',
12+
'DOAB',
13+
'JSTOR',
14+
'EBSCO Host',
15+
'OCLC KB',
16+
'ProQuest KB',
17+
'ProQuest ExLibris',
18+
'EBSCO KB',
19+
'JISC KB',
20+
'Google Books',
21+
'Internet Archive',
22+
'ScienceOpen',
23+
'SciELO Books',
24+
'Publisher Website',
25+
'Other'
26+
);
27+
ALTER TABLE location ALTER location_platform TYPE location_platform USING location_platform::location_platform;
28+
ALTER TABLE location
29+
ALTER COLUMN location_platform SET DEFAULT 'Other'::location_platform;
30+
31+
CREATE UNIQUE INDEX location_uniq_platform_idx
32+
ON location (publication_id, location_platform)
33+
WHERE NOT location_platform = 'Other'::location_platform;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TYPE location_platform ADD VALUE IF NOT EXISTS 'Zenodo';

thoth-api/src/model/location/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ pub enum LocationPlatform {
6060
#[cfg_attr(feature = "backend", db_rename = "SciELO Books")]
6161
#[strum(serialize = "SciELO Books")]
6262
ScieloBooks,
63+
#[cfg_attr(feature = "backend", db_rename = "Zenodo")]
64+
#[strum(serialize = "Zenodo")]
65+
Zenodo,
6366
#[cfg_attr(feature = "backend", db_rename = "Publisher Website")]
6467
#[strum(serialize = "Publisher Website")]
6568
PublisherWebsite,
@@ -183,6 +186,7 @@ fn test_locationplatform_display() {
183186
);
184187
assert_eq!(format!("{}", LocationPlatform::ScienceOpen), "ScienceOpen");
185188
assert_eq!(format!("{}", LocationPlatform::ScieloBooks), "SciELO Books");
189+
assert_eq!(format!("{}", LocationPlatform::Zenodo), "Zenodo");
186190
assert_eq!(
187191
format!("{}", LocationPlatform::PublisherWebsite),
188192
"Publisher Website"
@@ -249,6 +253,10 @@ fn test_locationplatform_fromstr() {
249253
LocationPlatform::from_str("SciELO Books").unwrap(),
250254
LocationPlatform::ScieloBooks
251255
);
256+
assert_eq!(
257+
LocationPlatform::from_str("Zenodo").unwrap(),
258+
LocationPlatform::Zenodo
259+
);
252260
assert_eq!(
253261
LocationPlatform::from_str("Publisher Website").unwrap(),
254262
LocationPlatform::PublisherWebsite

thoth-app-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app-server"
3-
version = "0.12.3"
3+
version = "0.12.4"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"

thoth-app/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app"
3-
version = "0.12.3"
3+
version = "0.12.4"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -36,8 +36,8 @@ uuid = { version = "0.8.2", features = ["serde", "v4"] }
3636
# `getrandom` is a dependency of `uuid`, we need to explicitly import and include the `js` feature to enable wasm
3737
# https://docs.rs/getrandom/latest/getrandom/#webassembly-support
3838
getrandom = { version = "0.2", features = ["js"] }
39-
thoth-api = { version = "0.12.3", path = "../thoth-api" }
40-
thoth-errors = { version = "0.12.3", path = "../thoth-errors" }
39+
thoth-api = { version = "=0.12.4", path = "../thoth-api" }
40+
thoth-errors = { version = "=0.12.4", path = "../thoth-errors" }
4141

4242
[build-dependencies]
4343
dotenv = "0.15.0"

0 commit comments

Comments
 (0)