Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump sea-orm from 0.12.4 to 0.12.5 in /deepwell #1696

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deepwell/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deepwell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords = ["wikijump", "api", "backend", "wiki"]
categories = ["asynchronous", "database", "web-programming::http-server"]
exclude = [".gitignore", ".editorconfig"]

version = "2023.10.27"
version = "2023.11.13"
authors = ["Emmie Maeda <[email protected]>"]
edition = "2021" # this is *not* the same as the current year

Expand Down
3 changes: 2 additions & 1 deletion deepwell/scripts/generate-models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ cd "${0%/*}/.."
sea-orm-cli generate entity \
--verbose \
--date-time-crate time \
--with-copy-enums \
--with-serde both \
--enum-extra-attributes 'serde(rename_all = "kebab-case")' \
--with-copy-enums \
--database-url postgres://wikijump:wikijump@localhost/wikijump \
--output-dir src/models
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
Loading