From b06470cd9b6faa542f658713a9761f4640f78ed1 Mon Sep 17 00:00:00 2001 From: Brendan OConnell Date: Mon, 19 Feb 2024 15:21:36 +0100 Subject: [PATCH 1/2] Added change to Changelog, added up and down migrations to default main_contribution to true --- CHANGELOG.md | 1 + thoth-api/migrations/v0.11.17/down.sql | 2 ++ thoth-api/migrations/v0.11.17/up.sql | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 thoth-api/migrations/v0.11.17/down.sql create mode 100644 thoth-api/migrations/v0.11.17/up.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index aafb7ddb..d7be20e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed + - [499](https://github.com/thoth-pub/thoth/issues/499) - Default main\_contribution to true - [561](https://github.com/thoth-pub/thoth/issues/561) - Add "Publisher Website" as a location platform - [553](https://github.com/thoth-pub/thoth/pull/553) - Upgrade rust to `1.76.0` in production and development `Dockerfile` - [305](https://github.com/thoth-pub/thoth/issues/305) - Update rust edition to 2021 diff --git a/thoth-api/migrations/v0.11.17/down.sql b/thoth-api/migrations/v0.11.17/down.sql new file mode 100644 index 00000000..055b53a9 --- /dev/null +++ b/thoth-api/migrations/v0.11.17/down.sql @@ -0,0 +1,2 @@ +ALTER TABLE contribution + ALTER COLUMN main_contribution SET DEFAULT False; diff --git a/thoth-api/migrations/v0.11.17/up.sql b/thoth-api/migrations/v0.11.17/up.sql new file mode 100644 index 00000000..87fe07b7 --- /dev/null +++ b/thoth-api/migrations/v0.11.17/up.sql @@ -0,0 +1,2 @@ +ALTER TABLE contribution + ALTER COLUMN main_contribution SET DEFAULT True; From 6a263fb4fb85cbf3f3c4c5a2e2b4a3e84dc93d20 Mon Sep 17 00:00:00 2001 From: Brendan OConnell Date: Mon, 19 Feb 2024 16:08:15 +0100 Subject: [PATCH 2/2] Changed main_contribution: true --- thoth-api/src/model/contribution/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thoth-api/src/model/contribution/mod.rs b/thoth-api/src/model/contribution/mod.rs index ae6c87be..aa670d6d 100644 --- a/thoth-api/src/model/contribution/mod.rs +++ b/thoth-api/src/model/contribution/mod.rs @@ -212,7 +212,7 @@ impl Default for Contribution { work_id: Default::default(), contributor_id: Default::default(), contribution_type: Default::default(), - main_contribution: Default::default(), + main_contribution: true, biography: Default::default(), created_at: Default::default(), updated_at: Default::default(),