Skip to content

Commit

Permalink
Add legal information (fixes #721) (#2273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic authored May 19, 2022
1 parent 60e9586 commit 9ef0efa
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/api_common/src/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pub struct EditSite {
pub private_instance: Option<bool>,
pub default_theme: Option<String>,
pub default_post_listing_type: Option<String>,
pub legal_information: Option<String>,
pub auth: Sensitive<String>,
}

Expand Down
1 change: 1 addition & 0 deletions crates/api_crud/src/site/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl PerformCrud for EditSite {
private_instance: data.private_instance,
default_theme: data.default_theme.clone(),
default_post_listing_type: data.default_post_listing_type.clone(),
legal_information: data.legal_information.clone(),
..SiteForm::default()
};

Expand Down
1 change: 1 addition & 0 deletions crates/db_schema/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ table! {
public_key -> Text,
default_theme -> Text,
default_post_listing_type -> Text,
legal_information -> Nullable<Text>,
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/db_schema/src/source/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct Site {
pub public_key: String,
pub default_theme: String,
pub default_post_listing_type: String,
pub legal_information: Option<String>,
}

#[derive(Default)]
Expand Down Expand Up @@ -59,4 +60,5 @@ pub struct SiteForm {
pub public_key: Option<String>,
pub default_theme: Option<String>,
pub default_post_listing_type: Option<String>,
pub legal_information: Option<String>,
}
1 change: 1 addition & 0 deletions migrations/2022-05-19-153931_legal-information/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table site drop column legal_information;
1 change: 1 addition & 0 deletions migrations/2022-05-19-153931_legal-information/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table site add column legal_information text;

0 comments on commit 9ef0efa

Please sign in to comment.