mirror of https://github.com/LemmyNet/lemmy
* Adding instance software and version. Fixes #2222 * Fix clippy. * Fix clippy 2 * Fixing some more issues.separate_comment_distinguish^2
parent
47f4aa3550
commit
3735c6fabf
@ -1,21 +1,30 @@
|
||||
use crate::newtypes::InstanceId;
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::instance;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Debug;
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
#[cfg_attr(feature = "full", diesel(table_name = instance))]
|
||||
pub struct Instance {
|
||||
pub id: InstanceId,
|
||||
pub domain: String,
|
||||
pub software: Option<String>,
|
||||
pub version: Option<String>,
|
||||
pub published: chrono::NaiveDateTime,
|
||||
pub updated: Option<chrono::NaiveDateTime>,
|
||||
}
|
||||
|
||||
#[derive(Clone, TypedBuilder)]
|
||||
#[builder(field_defaults(default))]
|
||||
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
||||
#[cfg_attr(feature = "full", diesel(table_name = instance))]
|
||||
pub struct InstanceForm {
|
||||
#[builder(!default)]
|
||||
pub domain: String,
|
||||
pub software: Option<String>,
|
||||
pub version: Option<String>,
|
||||
pub updated: Option<chrono::NaiveDateTime>,
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
alter table instance drop column software;
|
||||
alter table instance drop column version;
|
@ -0,0 +1,4 @@
|
||||
-- Add Software and Version columns from nodeinfo to the instance table
|
||||
|
||||
alter table instance add column software varchar(255);
|
||||
alter table instance add column version varchar(255);
|
Loading…
Reference in New Issue