Skip to content

Commit

Permalink
Update entity files.
Browse files Browse the repository at this point in the history
Finally, no more manual editing after running the script!
Very exciting. Now we just run this as-is, all set.
  • Loading branch information
emmiegit committed Nov 13, 2023
1 parent 76cf5ad commit 508f04d
Show file tree
Hide file tree
Showing 29 changed files with 62 additions and 37 deletions.
2 changes: 1 addition & 1 deletion deepwell/src/models/alias.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use super::sea_orm_active_enums::AliasType;
use sea_orm::entity::prelude::*;
Expand Down
8 changes: 7 additions & 1 deletion deepwell/src/models/file.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -52,4 +52,10 @@ impl Related<super::page::Entity> for Entity {
}
}

impl Related<super::site::Entity> for Entity {
fn to() -> RelationDef {
Relation::Site.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
8 changes: 7 additions & 1 deletion deepwell/src/models/file_revision.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use super::sea_orm_active_enums::FileRevisionType;
use sea_orm::entity::prelude::*;
Expand Down Expand Up @@ -78,6 +78,12 @@ impl Related<super::page::Entity> for Entity {
}
}

impl Related<super::site::Entity> for Entity {
fn to() -> RelationDef {
Relation::Site.def()
}
}

impl Related<super::user::Entity> for Entity {
fn to() -> RelationDef {
Relation::User.def()
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/filter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/interaction.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use super::sea_orm_active_enums::InteractionObjectType;
use sea_orm::entity::prelude::*;
Expand Down
3 changes: 1 addition & 2 deletions deepwell/src/models/message.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand All @@ -12,7 +12,6 @@ pub struct Model {
pub record_id: String,
pub user_id: i64,
pub flag_read: bool,
pub flag_seen: bool,
pub flag_inbox: bool,
pub flag_outbox: bool,
pub flag_self: bool,
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/message_draft.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/message_recipient.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use super::sea_orm_active_enums::MessageRecipientType;
use sea_orm::entity::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/message_record.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/message_report.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
pub mod prelude;

Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_attribution.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_category.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_connection.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_connection_missing.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_link.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_lock.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_parent.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 1 addition & 3 deletions deepwell/src/models/page_revision.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use super::sea_orm_active_enums::PageRevisionType;
use sea_orm::entity::prelude::*;
Expand All @@ -19,10 +19,8 @@ pub struct Model {
pub from_wikidot: bool,
pub changes: Vec<String>,
#[sea_orm(column_type = "Binary(BlobSize::Blob(None))")]
#[serde(skip)]
pub wikitext_hash: Vec<u8>,
#[sea_orm(column_type = "Binary(BlobSize::Blob(None))")]
#[serde(skip)]
pub compiled_hash: Vec<u8>,
pub compiled_at: TimeDateTimeWithTimeZone,
#[sea_orm(column_type = "Text")]
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/page_vote.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
pub use super::alias::Entity as Alias;
pub use super::file::Entity as File;
Expand Down
12 changes: 6 additions & 6 deletions deepwell/src/models/sea_orm_active_enums.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(
Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy, Serialize, Deserialize,
)]
#[serde(rename_all = "kebab-case")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "alias_type")]
#[serde(rename_all = "kebab-case")]
pub enum AliasType {
#[sea_orm(string_value = "site")]
Site,
Expand All @@ -17,8 +17,8 @@ pub enum AliasType {
#[derive(
Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy, Serialize, Deserialize,
)]
#[serde(rename_all = "kebab-case")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "file_revision_type")]
#[serde(rename_all = "kebab-case")]
pub enum FileRevisionType {
#[sea_orm(string_value = "create")]
Create,
Expand All @@ -32,12 +32,12 @@ pub enum FileRevisionType {
#[derive(
Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy, Serialize, Deserialize,
)]
#[serde(rename_all = "kebab-case")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "interaction_object_type"
)]
#[serde(rename_all = "kebab-case")]
pub enum InteractionObjectType {
#[sea_orm(string_value = "file")]
File,
Expand All @@ -51,12 +51,12 @@ pub enum InteractionObjectType {
#[derive(
Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy, Serialize, Deserialize,
)]
#[serde(rename_all = "kebab-case")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "message_recipient_type"
)]
#[serde(rename_all = "kebab-case")]
pub enum MessageRecipientType {
#[sea_orm(string_value = "bcc")]
Bcc,
Expand Down Expand Up @@ -85,8 +85,8 @@ pub enum PageRevisionType {
#[derive(
Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy, Serialize, Deserialize,
)]
#[serde(rename_all = "kebab-case")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "user_type")]
#[serde(rename_all = "kebab-case")]
pub enum UserType {
#[sea_orm(string_value = "bot")]
Bot,
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/session.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
18 changes: 17 additions & 1 deletion deepwell/src/models/site.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -30,6 +30,10 @@ pub struct Model {

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::file::Entity")]
File,
#[sea_orm(has_many = "super::file_revision::Entity")]
FileRevision,
#[sea_orm(has_many = "super::filter::Entity")]
Filter,
#[sea_orm(has_many = "super::message_report::Entity")]
Expand All @@ -50,6 +54,18 @@ pub enum Relation {
SiteDomain,
}

impl Related<super::file::Entity> for Entity {
fn to() -> RelationDef {
Relation::File.def()
}
}

impl Related<super::file_revision::Entity> for Entity {
fn to() -> RelationDef {
Relation::FileRevision.def()
}
}

impl Related<super::filter::Entity> for Entity {
fn to() -> RelationDef {
Relation::Filter.def()
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/site_domain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/text.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/user.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use super::sea_orm_active_enums::UserType;
use sea_orm::entity::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/models/user_bot_owner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.5
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 508f04d

Please sign in to comment.