]> Untitled Git - lemmy.git/commitdiff
Add legal information (fixes #721) (#2273)
authorNutomic <me@nutomic.com>
Thu, 19 May 2022 20:32:40 +0000 (20:32 +0000)
committerGitHub <noreply@github.com>
Thu, 19 May 2022 20:32:40 +0000 (20:32 +0000)
crates/api_common/src/site.rs
crates/api_crud/src/site/update.rs
crates/db_schema/src/schema.rs
crates/db_schema/src/source/site.rs
migrations/2022-05-19-153931_legal-information/down.sql [new file with mode: 0644]
migrations/2022-05-19-153931_legal-information/up.sql [new file with mode: 0644]

index 99c7b4e8eb3cd6218040b594a91f4a278bd0058a..71b3d0def1b1690404e5645900ff8ed8fa0d7da3 100644 (file)
@@ -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>,
 }
 
index 0251bddbdee8996c14c48875573bc46806bc67dc..ba09305412a3966f0bc57ee160a2d8913de77550 100644 (file)
@@ -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()
     };
 
index 3662d09598c54588d5a9cd1c6cb76b3b7f724cad..666986a691cb9e5a476c98a0cf7fcc0132dd5c9b 100644 (file)
@@ -463,6 +463,7 @@ table! {
         public_key -> Text,
         default_theme -> Text,
         default_post_listing_type -> Text,
+        legal_information -> Nullable<Text>,
     }
 }
 
index b43783669af3f0c454b66c49ed3be8293c7c95be..9ba8697527f2393a628ec773a81bcd74de5a179b 100644 (file)
@@ -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)]
@@ -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>,
 }
diff --git a/migrations/2022-05-19-153931_legal-information/down.sql b/migrations/2022-05-19-153931_legal-information/down.sql
new file mode 100644 (file)
index 0000000..0df8c19
--- /dev/null
@@ -0,0 +1 @@
+alter table site drop column legal_information;
\ No newline at end of file
diff --git a/migrations/2022-05-19-153931_legal-information/up.sql b/migrations/2022-05-19-153931_legal-information/up.sql
new file mode 100644 (file)
index 0000000..641fe63
--- /dev/null
@@ -0,0 +1 @@
+alter table site add column legal_information text;
\ No newline at end of file