From b0e8408776c9ec78dfc493bd52051f914d1047ec Mon Sep 17 00:00:00 2001 From: Natty Date: Sat, 29 Jul 2023 21:59:14 +0200 Subject: [PATCH] Updated entities and fixed unique relations --- .../src/entities/abuse_user_report.rs | 2 +- .../entity_ck/src/entities/access_token.rs | 2 +- .../entity_ck/src/entities/ad.rs | 2 +- .../entity_ck/src/entities/announcement.rs | 2 +- .../src/entities/announcement_read.rs | 2 +- .../entity_ck/src/entities/antenna.rs | 6 +- .../entity_ck/src/entities/antenna_note.rs | 2 +- .../entity_ck/src/entities/app.rs | 2 +- .../src/entities/attestation_challenge.rs | 2 +- .../entity_ck/src/entities/auth_session.rs | 2 +- .../entity_ck/src/entities/blocking.rs | 2 +- .../entity_ck/src/entities/channel.rs | 83 ------------------- .../src/entities/channel_following.rs | 51 ------------ .../src/entities/channel_note_pining.rs | 51 ------------ .../entity_ck/src/entities/clip.rs | 2 +- .../entity_ck/src/entities/clip_note.rs | 2 +- .../entity_ck/src/entities/drive_file.rs | 21 +---- .../entity_ck/src/entities/drive_folder.rs | 2 +- .../entity_ck/src/entities/emoji.rs | 2 +- .../entity_ck/src/entities/follow_request.rs | 2 +- .../entity_ck/src/entities/following.rs | 2 +- .../entity_ck/src/entities/gallery_like.rs | 2 +- .../entity_ck/src/entities/gallery_post.rs | 2 +- .../entity_ck/src/entities/hashtag.rs | 2 +- .../entity_ck/src/entities/instance.rs | 2 +- .../src/entities/messaging_message.rs | 76 ----------------- .../entity_ck/src/entities/meta.rs | 22 +---- .../entity_ck/src/entities/migrations.rs | 18 ---- .../entity_ck/src/entities/mod.rs | 7 +- .../entity_ck/src/entities/moderation_log.rs | 3 +- .../entity_ck/src/entities/muted_note.rs | 2 +- .../entity_ck/src/entities/muting.rs | 2 +- .../entity_ck/src/entities/note.rs | 27 +----- .../entity_ck/src/entities/note_edit.rs | 2 +- .../entity_ck/src/entities/note_favorite.rs | 2 +- .../entity_ck/src/entities/note_reaction.rs | 2 +- .../src/entities/note_thread_muting.rs | 2 +- .../entity_ck/src/entities/note_unread.rs | 4 +- .../entity_ck/src/entities/note_watching.rs | 2 +- .../entity_ck/src/entities/notification.rs | 2 +- .../entity_ck/src/entities/page.rs | 4 +- .../entity_ck/src/entities/page_like.rs | 2 +- .../src/entities/password_reset_request.rs | 2 +- .../entity_ck/src/entities/poll.rs | 2 +- .../entity_ck/src/entities/poll_vote.rs | 2 +- .../entity_ck/src/entities/prelude.rs | 7 +- .../entity_ck/src/entities/promo_note.rs | 2 +- .../entity_ck/src/entities/promo_read.rs | 2 +- .../src/entities/registration_ticket.rs | 2 +- .../entity_ck/src/entities/registry_item.rs | 3 +- .../entity_ck/src/entities/relay.rs | 2 +- .../entity_ck/src/entities/renote_muting.rs | 2 +- .../src/entities/sea_orm_active_enums.rs | 34 +++++++- .../entity_ck/src/entities/signin.rs | 3 +- .../entity_ck/src/entities/sw_subscription.rs | 2 +- .../entity_ck/src/entities/used_username.rs | 2 +- .../entity_ck/src/entities/user.rs | 18 +--- .../entity_ck/src/entities/user_group.rs | 10 +-- .../src/entities/user_group_invitation.rs | 2 +- .../src/entities/user_group_invite.rs | 2 +- .../src/entities/user_group_joining.rs | 2 +- .../entity_ck/src/entities/user_ip.rs | 2 +- .../entity_ck/src/entities/user_keypair.rs | 2 +- .../entity_ck/src/entities/user_list.rs | 2 +- .../src/entities/user_list_joining.rs | 2 +- .../src/entities/user_note_pining.rs | 2 +- .../entity_ck/src/entities/user_pending.rs | 2 +- .../entity_ck/src/entities/user_profile.rs | 16 ++-- .../entity_ck/src/entities/user_publickey.rs | 2 +- .../src/entities/user_security_key.rs | 2 +- .../entity_ck/src/entities/webhook.rs | 2 +- ext_calckey_model/migration/src/lib.rs | 2 + .../src/m20230729_212237_user_unique_idx.rs | 41 +++++++++ 73 files changed, 162 insertions(+), 447 deletions(-) delete mode 100644 ext_calckey_model/entity_ck/src/entities/channel.rs delete mode 100644 ext_calckey_model/entity_ck/src/entities/channel_following.rs delete mode 100644 ext_calckey_model/entity_ck/src/entities/channel_note_pining.rs delete mode 100644 ext_calckey_model/entity_ck/src/entities/messaging_message.rs delete mode 100644 ext_calckey_model/entity_ck/src/entities/migrations.rs create mode 100644 ext_calckey_model/migration/src/m20230729_212237_user_unique_idx.rs diff --git a/ext_calckey_model/entity_ck/src/entities/abuse_user_report.rs b/ext_calckey_model/entity_ck/src/entities/abuse_user_report.rs index c7134a6..161e890 100644 --- a/ext_calckey_model/entity_ck/src/entities/abuse_user_report.rs +++ b/ext_calckey_model/entity_ck/src/entities/abuse_user_report.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/access_token.rs b/ext_calckey_model/entity_ck/src/entities/access_token.rs index d96642b..82df53b 100644 --- a/ext_calckey_model/entity_ck/src/entities/access_token.rs +++ b/ext_calckey_model/entity_ck/src/entities/access_token.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/ad.rs b/ext_calckey_model/entity_ck/src/entities/ad.rs index a56b0f6..623d5ff 100644 --- a/ext_calckey_model/entity_ck/src/entities/ad.rs +++ b/ext_calckey_model/entity_ck/src/entities/ad.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/announcement.rs b/ext_calckey_model/entity_ck/src/entities/announcement.rs index 452214a..429aed5 100644 --- a/ext_calckey_model/entity_ck/src/entities/announcement.rs +++ b/ext_calckey_model/entity_ck/src/entities/announcement.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/announcement_read.rs b/ext_calckey_model/entity_ck/src/entities/announcement_read.rs index a3e5442..ae6366e 100644 --- a/ext_calckey_model/entity_ck/src/entities/announcement_read.rs +++ b/ext_calckey_model/entity_ck/src/entities/announcement_read.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/antenna.rs b/ext_calckey_model/entity_ck/src/entities/antenna.rs index e49439b..adc277d 100644 --- a/ext_calckey_model/entity_ck/src/entities/antenna.rs +++ b/ext_calckey_model/entity_ck/src/entities/antenna.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::AntennaSrcEnum; use sea_orm::entity::prelude::*; @@ -17,6 +17,7 @@ pub struct Model { pub src: AntennaSrcEnum, #[sea_orm(column_name = "userListId")] pub user_list_id: Option, + #[sea_orm(column_type = "JsonBinary")] pub keywords: Json, #[sea_orm(column_name = "withFile")] pub with_file: bool, @@ -29,8 +30,9 @@ pub struct Model { #[sea_orm(column_name = "userGroupJoiningId")] pub user_group_joining_id: Option, pub users: Vec, - #[sea_orm(column_name = "excludeKeywords")] + #[sea_orm(column_name = "excludeKeywords", column_type = "JsonBinary")] pub exclude_keywords: Json, + #[sea_orm(column_type = "JsonBinary")] pub instances: Json, } diff --git a/ext_calckey_model/entity_ck/src/entities/antenna_note.rs b/ext_calckey_model/entity_ck/src/entities/antenna_note.rs index 0a8f0b3..2ad870f 100644 --- a/ext_calckey_model/entity_ck/src/entities/antenna_note.rs +++ b/ext_calckey_model/entity_ck/src/entities/antenna_note.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/app.rs b/ext_calckey_model/entity_ck/src/entities/app.rs index 5fa1f65..ff4b41e 100644 --- a/ext_calckey_model/entity_ck/src/entities/app.rs +++ b/ext_calckey_model/entity_ck/src/entities/app.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/attestation_challenge.rs b/ext_calckey_model/entity_ck/src/entities/attestation_challenge.rs index de42079..004ea17 100644 --- a/ext_calckey_model/entity_ck/src/entities/attestation_challenge.rs +++ b/ext_calckey_model/entity_ck/src/entities/attestation_challenge.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/auth_session.rs b/ext_calckey_model/entity_ck/src/entities/auth_session.rs index 8585fa9..63a432e 100644 --- a/ext_calckey_model/entity_ck/src/entities/auth_session.rs +++ b/ext_calckey_model/entity_ck/src/entities/auth_session.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/blocking.rs b/ext_calckey_model/entity_ck/src/entities/blocking.rs index ae899b9..527ec57 100644 --- a/ext_calckey_model/entity_ck/src/entities/blocking.rs +++ b/ext_calckey_model/entity_ck/src/entities/blocking.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/channel.rs b/ext_calckey_model/entity_ck/src/entities/channel.rs deleted file mode 100644 index ebfa81e..0000000 --- a/ext_calckey_model/entity_ck/src/entities/channel.rs +++ /dev/null @@ -1,83 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 - -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "channel")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: String, - #[sea_orm(column_name = "createdAt")] - pub created_at: DateTimeWithTimeZone, - #[sea_orm(column_name = "lastNotedAt")] - pub last_noted_at: Option, - #[sea_orm(column_name = "userId")] - pub user_id: Option, - pub name: String, - pub description: Option, - #[sea_orm(column_name = "bannerId")] - pub banner_id: Option, - #[sea_orm(column_name = "notesCount")] - pub notes_count: i32, - #[sea_orm(column_name = "usersCount")] - pub users_count: i32, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::channel_following::Entity")] - ChannelFollowing, - #[sea_orm(has_many = "super::channel_note_pining::Entity")] - ChannelNotePining, - #[sea_orm( - belongs_to = "super::drive_file::Entity", - from = "Column::BannerId", - to = "super::drive_file::Column::Id", - on_update = "NoAction", - on_delete = "SetNull" - )] - DriveFile, - #[sea_orm(has_many = "super::note::Entity")] - Note, - #[sea_orm( - belongs_to = "super::user::Entity", - from = "Column::UserId", - to = "super::user::Column::Id", - on_update = "NoAction", - on_delete = "SetNull" - )] - User, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::ChannelFollowing.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::ChannelNotePining.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::DriveFile.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Note.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::User.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/ext_calckey_model/entity_ck/src/entities/channel_following.rs b/ext_calckey_model/entity_ck/src/entities/channel_following.rs deleted file mode 100644 index b341400..0000000 --- a/ext_calckey_model/entity_ck/src/entities/channel_following.rs +++ /dev/null @@ -1,51 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 - -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "channel_following")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: String, - #[sea_orm(column_name = "createdAt")] - pub created_at: DateTimeWithTimeZone, - #[sea_orm(column_name = "followeeId")] - pub followee_id: String, - #[sea_orm(column_name = "followerId")] - pub follower_id: String, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::channel::Entity", - from = "Column::FolloweeId", - to = "super::channel::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Channel, - #[sea_orm( - belongs_to = "super::user::Entity", - from = "Column::FollowerId", - to = "super::user::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - User, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Channel.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::User.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/ext_calckey_model/entity_ck/src/entities/channel_note_pining.rs b/ext_calckey_model/entity_ck/src/entities/channel_note_pining.rs deleted file mode 100644 index 87f3e6e..0000000 --- a/ext_calckey_model/entity_ck/src/entities/channel_note_pining.rs +++ /dev/null @@ -1,51 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 - -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "channel_note_pining")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: String, - #[sea_orm(column_name = "createdAt")] - pub created_at: DateTimeWithTimeZone, - #[sea_orm(column_name = "channelId")] - pub channel_id: String, - #[sea_orm(column_name = "noteId")] - pub note_id: String, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::channel::Entity", - from = "Column::ChannelId", - to = "super::channel::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Channel, - #[sea_orm( - belongs_to = "super::note::Entity", - from = "Column::NoteId", - to = "super::note::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Note, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Channel.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Note.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/ext_calckey_model/entity_ck/src/entities/clip.rs b/ext_calckey_model/entity_ck/src/entities/clip.rs index f979e20..7763886 100644 --- a/ext_calckey_model/entity_ck/src/entities/clip.rs +++ b/ext_calckey_model/entity_ck/src/entities/clip.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/clip_note.rs b/ext_calckey_model/entity_ck/src/entities/clip_note.rs index b93ffd2..ca915cd 100644 --- a/ext_calckey_model/entity_ck/src/entities/clip_note.rs +++ b/ext_calckey_model/entity_ck/src/entities/clip_note.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/drive_file.rs b/ext_calckey_model/entity_ck/src/entities/drive_file.rs index 84900cb..193fff4 100644 --- a/ext_calckey_model/entity_ck/src/entities/drive_file.rs +++ b/ext_calckey_model/entity_ck/src/entities/drive_file.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -19,6 +19,7 @@ pub struct Model { pub r#type: String, pub size: i32, pub comment: Option, + #[sea_orm(column_type = "JsonBinary")] pub properties: Json, #[sea_orm(column_name = "storedInternal")] pub stored_internal: bool, @@ -44,7 +45,7 @@ pub struct Model { pub blurhash: Option, #[sea_orm(column_name = "webpublicType")] pub webpublic_type: Option, - #[sea_orm(column_name = "requestHeaders")] + #[sea_orm(column_name = "requestHeaders", column_type = "JsonBinary", nullable)] pub request_headers: Option, #[sea_orm(column_name = "requestIp")] pub request_ip: Option, @@ -56,8 +57,6 @@ pub struct Model { #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { - #[sea_orm(has_many = "super::channel::Entity")] - Channel, #[sea_orm( belongs_to = "super::drive_folder::Entity", from = "Column::FolderId", @@ -66,8 +65,6 @@ pub enum Relation { on_delete = "SetNull" )] DriveFolder, - #[sea_orm(has_many = "super::messaging_message::Entity")] - MessagingMessage, #[sea_orm(has_many = "super::page::Entity")] Page, #[sea_orm( @@ -80,24 +77,12 @@ pub enum Relation { User, } -impl Related for Entity { - fn to() -> RelationDef { - Relation::Channel.def() - } -} - impl Related for Entity { fn to() -> RelationDef { Relation::DriveFolder.def() } } -impl Related for Entity { - fn to() -> RelationDef { - Relation::MessagingMessage.def() - } -} - impl Related for Entity { fn to() -> RelationDef { Relation::Page.def() diff --git a/ext_calckey_model/entity_ck/src/entities/drive_folder.rs b/ext_calckey_model/entity_ck/src/entities/drive_folder.rs index 47b28d3..fb4418f 100644 --- a/ext_calckey_model/entity_ck/src/entities/drive_folder.rs +++ b/ext_calckey_model/entity_ck/src/entities/drive_folder.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/emoji.rs b/ext_calckey_model/entity_ck/src/entities/emoji.rs index 8378586..ea75e8b 100644 --- a/ext_calckey_model/entity_ck/src/entities/emoji.rs +++ b/ext_calckey_model/entity_ck/src/entities/emoji.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/follow_request.rs b/ext_calckey_model/entity_ck/src/entities/follow_request.rs index d016bc4..0677ee3 100644 --- a/ext_calckey_model/entity_ck/src/entities/follow_request.rs +++ b/ext_calckey_model/entity_ck/src/entities/follow_request.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/following.rs b/ext_calckey_model/entity_ck/src/entities/following.rs index 9808d17..9f889a5 100644 --- a/ext_calckey_model/entity_ck/src/entities/following.rs +++ b/ext_calckey_model/entity_ck/src/entities/following.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/gallery_like.rs b/ext_calckey_model/entity_ck/src/entities/gallery_like.rs index 96b6778..c8a05db 100644 --- a/ext_calckey_model/entity_ck/src/entities/gallery_like.rs +++ b/ext_calckey_model/entity_ck/src/entities/gallery_like.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/gallery_post.rs b/ext_calckey_model/entity_ck/src/entities/gallery_post.rs index d8ed179..9491201 100644 --- a/ext_calckey_model/entity_ck/src/entities/gallery_post.rs +++ b/ext_calckey_model/entity_ck/src/entities/gallery_post.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/hashtag.rs b/ext_calckey_model/entity_ck/src/entities/hashtag.rs index 3b8c52e..bcf18b6 100644 --- a/ext_calckey_model/entity_ck/src/entities/hashtag.rs +++ b/ext_calckey_model/entity_ck/src/entities/hashtag.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/instance.rs b/ext_calckey_model/entity_ck/src/entities/instance.rs index 17e1325..70cf428 100644 --- a/ext_calckey_model/entity_ck/src/entities/instance.rs +++ b/ext_calckey_model/entity_ck/src/entities/instance.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/messaging_message.rs b/ext_calckey_model/entity_ck/src/entities/messaging_message.rs deleted file mode 100644 index f6c1478..0000000 --- a/ext_calckey_model/entity_ck/src/entities/messaging_message.rs +++ /dev/null @@ -1,76 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 - -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "messaging_message")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: String, - #[sea_orm(column_name = "createdAt")] - pub created_at: DateTimeWithTimeZone, - #[sea_orm(column_name = "userId")] - pub user_id: String, - #[sea_orm(column_name = "recipientId")] - pub recipient_id: Option, - pub text: Option, - #[sea_orm(column_name = "isRead")] - pub is_read: bool, - #[sea_orm(column_name = "fileId")] - pub file_id: Option, - #[sea_orm(column_name = "groupId")] - pub group_id: Option, - pub reads: Vec, - pub uri: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::drive_file::Entity", - from = "Column::FileId", - to = "super::drive_file::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - DriveFile, - #[sea_orm( - belongs_to = "super::user::Entity", - from = "Column::UserId", - to = "super::user::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - User2, - #[sea_orm( - belongs_to = "super::user::Entity", - from = "Column::RecipientId", - to = "super::user::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - User1, - #[sea_orm( - belongs_to = "super::user_group::Entity", - from = "Column::GroupId", - to = "super::user_group::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - UserGroup, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::DriveFile.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::UserGroup.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/ext_calckey_model/entity_ck/src/entities/meta.rs b/ext_calckey_model/entity_ck/src/entities/meta.rs index 6fdd292..e399dad 100644 --- a/ext_calckey_model/entity_ck/src/entities/meta.rs +++ b/ext_calckey_model/entity_ck/src/entities/meta.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::MetaSensitivemediadetectionEnum; use super::sea_orm_active_enums::MetaSensitivemediadetectionsensitivityEnum; @@ -70,24 +70,6 @@ pub struct Model { pub sw_public_key: Option, #[sea_orm(column_name = "swPrivateKey")] pub sw_private_key: Option, - #[sea_orm(column_name = "enableTwitterIntegration")] - pub enable_twitter_integration: bool, - #[sea_orm(column_name = "twitterConsumerKey")] - pub twitter_consumer_key: Option, - #[sea_orm(column_name = "twitterConsumerSecret")] - pub twitter_consumer_secret: Option, - #[sea_orm(column_name = "enableGithubIntegration")] - pub enable_github_integration: bool, - #[sea_orm(column_name = "githubClientId")] - pub github_client_id: Option, - #[sea_orm(column_name = "githubClientSecret")] - pub github_client_secret: Option, - #[sea_orm(column_name = "enableDiscordIntegration")] - pub enable_discord_integration: bool, - #[sea_orm(column_name = "discordClientId")] - pub discord_client_id: Option, - #[sea_orm(column_name = "discordClientSecret")] - pub discord_client_secret: Option, #[sea_orm(column_name = "pinnedUsers")] pub pinned_users: Vec, #[sea_orm(column_name = "ToSUrl")] @@ -186,7 +168,7 @@ pub struct Model { pub libre_translate_api_key: Option, #[sea_orm(column_name = "silencedHosts")] pub silenced_hosts: Vec, - #[sea_orm(column_name = "experimentalFeatures")] + #[sea_orm(column_name = "experimentalFeatures", column_type = "JsonBinary")] pub experimental_features: Json, } diff --git a/ext_calckey_model/entity_ck/src/entities/migrations.rs b/ext_calckey_model/entity_ck/src/entities/migrations.rs deleted file mode 100644 index cb1f273..0000000 --- a/ext_calckey_model/entity_ck/src/entities/migrations.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 - -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "migrations")] -pub struct Model { - #[sea_orm(primary_key)] - pub id: i32, - pub timestamp: i64, - pub name: String, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation {} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/ext_calckey_model/entity_ck/src/entities/mod.rs b/ext_calckey_model/entity_ck/src/entities/mod.rs index 2ec5793..976b0d9 100644 --- a/ext_calckey_model/entity_ck/src/entities/mod.rs +++ b/ext_calckey_model/entity_ck/src/entities/mod.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 pub mod prelude; @@ -13,9 +13,6 @@ pub mod app; pub mod attestation_challenge; pub mod auth_session; pub mod blocking; -pub mod channel; -pub mod channel_following; -pub mod channel_note_pining; pub mod clip; pub mod clip_note; pub mod drive_file; @@ -27,9 +24,7 @@ pub mod gallery_like; pub mod gallery_post; pub mod hashtag; pub mod instance; -pub mod messaging_message; pub mod meta; -pub mod migrations; pub mod moderation_log; pub mod muted_note; pub mod muting; diff --git a/ext_calckey_model/entity_ck/src/entities/moderation_log.rs b/ext_calckey_model/entity_ck/src/entities/moderation_log.rs index 85b46b8..141b8db 100644 --- a/ext_calckey_model/entity_ck/src/entities/moderation_log.rs +++ b/ext_calckey_model/entity_ck/src/entities/moderation_log.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -13,6 +13,7 @@ pub struct Model { #[sea_orm(column_name = "userId")] pub user_id: String, pub r#type: String, + #[sea_orm(column_type = "JsonBinary")] pub info: Json, } diff --git a/ext_calckey_model/entity_ck/src/entities/muted_note.rs b/ext_calckey_model/entity_ck/src/entities/muted_note.rs index c76c06b..0b2753c 100644 --- a/ext_calckey_model/entity_ck/src/entities/muted_note.rs +++ b/ext_calckey_model/entity_ck/src/entities/muted_note.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::MutedNoteReasonEnum; use sea_orm::entity::prelude::*; diff --git a/ext_calckey_model/entity_ck/src/entities/muting.rs b/ext_calckey_model/entity_ck/src/entities/muting.rs index 954343d..da9b687 100644 --- a/ext_calckey_model/entity_ck/src/entities/muting.rs +++ b/ext_calckey_model/entity_ck/src/entities/muting.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/note.rs b/ext_calckey_model/entity_ck/src/entities/note.rs index 3c3a7cc..485dbbe 100644 --- a/ext_calckey_model/entity_ck/src/entities/note.rs +++ b/ext_calckey_model/entity_ck/src/entities/note.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::NoteVisibilityEnum; use sea_orm::entity::prelude::*; @@ -27,6 +27,7 @@ pub struct Model { pub renote_count: i16, #[sea_orm(column_name = "repliesCount")] pub replies_count: i16, + #[sea_orm(column_type = "JsonBinary")] pub reactions: Json, pub visibility: NoteVisibilityEnum, pub uri: Option, @@ -55,8 +56,6 @@ pub struct Model { #[sea_orm(column_name = "renoteUserHost")] pub renote_user_host: Option, pub url: Option, - #[sea_orm(column_name = "channelId")] - pub channel_id: Option, #[sea_orm(column_name = "threadId")] pub thread_id: Option, #[sea_orm(column_name = "updatedAt")] @@ -67,16 +66,6 @@ pub struct Model { pub enum Relation { #[sea_orm(has_many = "super::antenna_note::Entity")] AntennaNote, - #[sea_orm( - belongs_to = "super::channel::Entity", - from = "Column::ChannelId", - to = "super::channel::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Channel, - #[sea_orm(has_many = "super::channel_note_pining::Entity")] - ChannelNotePining, #[sea_orm(has_many = "super::clip_note::Entity")] ClipNote, #[sea_orm(has_many = "super::muted_note::Entity")] @@ -135,18 +124,6 @@ impl Related for Entity { } } -impl Related for Entity { - fn to() -> RelationDef { - Relation::Channel.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::ChannelNotePining.def() - } -} - impl Related for Entity { fn to() -> RelationDef { Relation::ClipNote.def() diff --git a/ext_calckey_model/entity_ck/src/entities/note_edit.rs b/ext_calckey_model/entity_ck/src/entities/note_edit.rs index 1e43bbe..13a3524 100644 --- a/ext_calckey_model/entity_ck/src/entities/note_edit.rs +++ b/ext_calckey_model/entity_ck/src/entities/note_edit.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/note_favorite.rs b/ext_calckey_model/entity_ck/src/entities/note_favorite.rs index 931bbff..16fdbe9 100644 --- a/ext_calckey_model/entity_ck/src/entities/note_favorite.rs +++ b/ext_calckey_model/entity_ck/src/entities/note_favorite.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/note_reaction.rs b/ext_calckey_model/entity_ck/src/entities/note_reaction.rs index f8118a9..ba4275b 100644 --- a/ext_calckey_model/entity_ck/src/entities/note_reaction.rs +++ b/ext_calckey_model/entity_ck/src/entities/note_reaction.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/note_thread_muting.rs b/ext_calckey_model/entity_ck/src/entities/note_thread_muting.rs index dc30335..1fdca77 100644 --- a/ext_calckey_model/entity_ck/src/entities/note_thread_muting.rs +++ b/ext_calckey_model/entity_ck/src/entities/note_thread_muting.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/note_unread.rs b/ext_calckey_model/entity_ck/src/entities/note_unread.rs index 11da3c4..772d6be 100644 --- a/ext_calckey_model/entity_ck/src/entities/note_unread.rs +++ b/ext_calckey_model/entity_ck/src/entities/note_unread.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -18,8 +18,6 @@ pub struct Model { pub is_specified: bool, #[sea_orm(column_name = "isMentioned")] pub is_mentioned: bool, - #[sea_orm(column_name = "noteChannelId")] - pub note_channel_id: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/ext_calckey_model/entity_ck/src/entities/note_watching.rs b/ext_calckey_model/entity_ck/src/entities/note_watching.rs index ad40d04..a243806 100644 --- a/ext_calckey_model/entity_ck/src/entities/note_watching.rs +++ b/ext_calckey_model/entity_ck/src/entities/note_watching.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/notification.rs b/ext_calckey_model/entity_ck/src/entities/notification.rs index fcad1af..e9dd675 100644 --- a/ext_calckey_model/entity_ck/src/entities/notification.rs +++ b/ext_calckey_model/entity_ck/src/entities/notification.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::NotificationTypeEnum; use sea_orm::entity::prelude::*; diff --git a/ext_calckey_model/entity_ck/src/entities/page.rs b/ext_calckey_model/entity_ck/src/entities/page.rs index a677496..571a3ff 100644 --- a/ext_calckey_model/entity_ck/src/entities/page.rs +++ b/ext_calckey_model/entity_ck/src/entities/page.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::PageVisibilityEnum; use sea_orm::entity::prelude::*; @@ -23,7 +23,9 @@ pub struct Model { pub user_id: String, #[sea_orm(column_name = "eyeCatchingImageId")] pub eye_catching_image_id: Option, + #[sea_orm(column_type = "JsonBinary")] pub content: Json, + #[sea_orm(column_type = "JsonBinary")] pub variables: Json, pub visibility: PageVisibilityEnum, #[sea_orm(column_name = "visibleUserIds")] diff --git a/ext_calckey_model/entity_ck/src/entities/page_like.rs b/ext_calckey_model/entity_ck/src/entities/page_like.rs index 4128d87..9e450d2 100644 --- a/ext_calckey_model/entity_ck/src/entities/page_like.rs +++ b/ext_calckey_model/entity_ck/src/entities/page_like.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/password_reset_request.rs b/ext_calckey_model/entity_ck/src/entities/password_reset_request.rs index ef55e50..c4de2a8 100644 --- a/ext_calckey_model/entity_ck/src/entities/password_reset_request.rs +++ b/ext_calckey_model/entity_ck/src/entities/password_reset_request.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/poll.rs b/ext_calckey_model/entity_ck/src/entities/poll.rs index 0aea78b..be489a0 100644 --- a/ext_calckey_model/entity_ck/src/entities/poll.rs +++ b/ext_calckey_model/entity_ck/src/entities/poll.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::PollNotevisibilityEnum; use sea_orm::entity::prelude::*; diff --git a/ext_calckey_model/entity_ck/src/entities/poll_vote.rs b/ext_calckey_model/entity_ck/src/entities/poll_vote.rs index 67a6234..01a46d4 100644 --- a/ext_calckey_model/entity_ck/src/entities/poll_vote.rs +++ b/ext_calckey_model/entity_ck/src/entities/poll_vote.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/prelude.rs b/ext_calckey_model/entity_ck/src/entities/prelude.rs index 5f58670..5a654e2 100644 --- a/ext_calckey_model/entity_ck/src/entities/prelude.rs +++ b/ext_calckey_model/entity_ck/src/entities/prelude.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 pub use super::abuse_user_report::Entity as AbuseUserReport; pub use super::access_token::Entity as AccessToken; @@ -11,9 +11,6 @@ pub use super::app::Entity as App; pub use super::attestation_challenge::Entity as AttestationChallenge; pub use super::auth_session::Entity as AuthSession; pub use super::blocking::Entity as Blocking; -pub use super::channel::Entity as Channel; -pub use super::channel_following::Entity as ChannelFollowing; -pub use super::channel_note_pining::Entity as ChannelNotePining; pub use super::clip::Entity as Clip; pub use super::clip_note::Entity as ClipNote; pub use super::drive_file::Entity as DriveFile; @@ -25,9 +22,7 @@ pub use super::gallery_like::Entity as GalleryLike; pub use super::gallery_post::Entity as GalleryPost; pub use super::hashtag::Entity as Hashtag; pub use super::instance::Entity as Instance; -pub use super::messaging_message::Entity as MessagingMessage; pub use super::meta::Entity as Meta; -pub use super::migrations::Entity as Migrations; pub use super::moderation_log::Entity as ModerationLog; pub use super::muted_note::Entity as MutedNote; pub use super::muting::Entity as Muting; diff --git a/ext_calckey_model/entity_ck/src/entities/promo_note.rs b/ext_calckey_model/entity_ck/src/entities/promo_note.rs index 353d504..c1a381c 100644 --- a/ext_calckey_model/entity_ck/src/entities/promo_note.rs +++ b/ext_calckey_model/entity_ck/src/entities/promo_note.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/promo_read.rs b/ext_calckey_model/entity_ck/src/entities/promo_read.rs index 0018553..2fc506e 100644 --- a/ext_calckey_model/entity_ck/src/entities/promo_read.rs +++ b/ext_calckey_model/entity_ck/src/entities/promo_read.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/registration_ticket.rs b/ext_calckey_model/entity_ck/src/entities/registration_ticket.rs index b6c0386..a8d7576 100644 --- a/ext_calckey_model/entity_ck/src/entities/registration_ticket.rs +++ b/ext_calckey_model/entity_ck/src/entities/registration_ticket.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/registry_item.rs b/ext_calckey_model/entity_ck/src/entities/registry_item.rs index 435246f..ecd4949 100644 --- a/ext_calckey_model/entity_ck/src/entities/registry_item.rs +++ b/ext_calckey_model/entity_ck/src/entities/registry_item.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -17,6 +17,7 @@ pub struct Model { pub key: String, pub scope: Vec, pub domain: Option, + #[sea_orm(column_type = "JsonBinary", nullable)] pub value: Option, } diff --git a/ext_calckey_model/entity_ck/src/entities/relay.rs b/ext_calckey_model/entity_ck/src/entities/relay.rs index 773c73a..39f2a14 100644 --- a/ext_calckey_model/entity_ck/src/entities/relay.rs +++ b/ext_calckey_model/entity_ck/src/entities/relay.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::RelayStatusEnum; use sea_orm::entity::prelude::*; diff --git a/ext_calckey_model/entity_ck/src/entities/renote_muting.rs b/ext_calckey_model/entity_ck/src/entities/renote_muting.rs index ecdd9d1..05e3526 100644 --- a/ext_calckey_model/entity_ck/src/entities/renote_muting.rs +++ b/ext_calckey_model/entity_ck/src/entities/renote_muting.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/sea_orm_active_enums.rs b/ext_calckey_model/entity_ck/src/entities/sea_orm_active_enums.rs index acd1eb1..da7f3aa 100644 --- a/ext_calckey_model/entity_ck/src/entities/sea_orm_active_enums.rs +++ b/ext_calckey_model/entity_ck/src/entities/sea_orm_active_enums.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -173,3 +173,35 @@ pub enum UserProfileFfvisibilityEnum { #[sea_orm(string_value = "public")] Public, } +#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Copy, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "user_profile_mutingnotificationtypes_enum" +)] +pub enum UserProfileMutingnotificationtypesEnum { + #[sea_orm(string_value = "app")] + App, + #[sea_orm(string_value = "follow")] + Follow, + #[sea_orm(string_value = "followRequestAccepted")] + FollowRequestAccepted, + #[sea_orm(string_value = "groupInvited")] + GroupInvited, + #[sea_orm(string_value = "mention")] + Mention, + #[sea_orm(string_value = "pollEnded")] + PollEnded, + #[sea_orm(string_value = "pollVote")] + PollVote, + #[sea_orm(string_value = "quote")] + Quote, + #[sea_orm(string_value = "reaction")] + Reaction, + #[sea_orm(string_value = "receiveFollowRequest")] + ReceiveFollowRequest, + #[sea_orm(string_value = "renote")] + Renote, + #[sea_orm(string_value = "reply")] + Reply, +} diff --git a/ext_calckey_model/entity_ck/src/entities/signin.rs b/ext_calckey_model/entity_ck/src/entities/signin.rs index 7ebb2a2..2bac895 100644 --- a/ext_calckey_model/entity_ck/src/entities/signin.rs +++ b/ext_calckey_model/entity_ck/src/entities/signin.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -13,6 +13,7 @@ pub struct Model { #[sea_orm(column_name = "userId")] pub user_id: String, pub ip: String, + #[sea_orm(column_type = "JsonBinary")] pub headers: Json, pub success: bool, } diff --git a/ext_calckey_model/entity_ck/src/entities/sw_subscription.rs b/ext_calckey_model/entity_ck/src/entities/sw_subscription.rs index 393a7ad..b633f8b 100644 --- a/ext_calckey_model/entity_ck/src/entities/sw_subscription.rs +++ b/ext_calckey_model/entity_ck/src/entities/sw_subscription.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/used_username.rs b/ext_calckey_model/entity_ck/src/entities/used_username.rs index d021a19..61dda26 100644 --- a/ext_calckey_model/entity_ck/src/entities/used_username.rs +++ b/ext_calckey_model/entity_ck/src/entities/used_username.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user.rs b/ext_calckey_model/entity_ck/src/entities/user.rs index f61d281..60862aa 100644 --- a/ext_calckey_model/entity_ck/src/entities/user.rs +++ b/ext_calckey_model/entity_ck/src/entities/user.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -86,10 +86,6 @@ pub enum Relation { AttestationChallenge, #[sea_orm(has_many = "super::auth_session::Entity")] AuthSession, - #[sea_orm(has_many = "super::channel::Entity")] - Channel, - #[sea_orm(has_many = "super::channel_following::Entity")] - ChannelFollowing, #[sea_orm(has_many = "super::clip::Entity")] Clip, #[sea_orm( @@ -210,18 +206,6 @@ impl Related for Entity { } } -impl Related for Entity { - fn to() -> RelationDef { - Relation::Channel.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::ChannelFollowing.def() - } -} - impl Related for Entity { fn to() -> RelationDef { Relation::Clip.def() diff --git a/ext_calckey_model/entity_ck/src/entities/user_group.rs b/ext_calckey_model/entity_ck/src/entities/user_group.rs index 47600f8..d8c026a 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_group.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_group.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -19,8 +19,6 @@ pub struct Model { #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { - #[sea_orm(has_many = "super::messaging_message::Entity")] - MessagingMessage, #[sea_orm( belongs_to = "super::user::Entity", from = "Column::UserId", @@ -37,12 +35,6 @@ pub enum Relation { UserGroupJoining, } -impl Related for Entity { - fn to() -> RelationDef { - Relation::MessagingMessage.def() - } -} - impl Related for Entity { fn to() -> RelationDef { Relation::User.def() diff --git a/ext_calckey_model/entity_ck/src/entities/user_group_invitation.rs b/ext_calckey_model/entity_ck/src/entities/user_group_invitation.rs index 5b90b1a..7441714 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_group_invitation.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_group_invitation.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_group_invite.rs b/ext_calckey_model/entity_ck/src/entities/user_group_invite.rs index c625966..baea19d 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_group_invite.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_group_invite.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_group_joining.rs b/ext_calckey_model/entity_ck/src/entities/user_group_joining.rs index fd92917..a086642 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_group_joining.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_group_joining.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_ip.rs b/ext_calckey_model/entity_ck/src/entities/user_ip.rs index acc8e97..9cd04ab 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_ip.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_ip.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_keypair.rs b/ext_calckey_model/entity_ck/src/entities/user_keypair.rs index 0c78510..e2e61d0 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_keypair.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_keypair.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_list.rs b/ext_calckey_model/entity_ck/src/entities/user_list.rs index 0c1145a..78f8cc5 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_list.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_list.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_list_joining.rs b/ext_calckey_model/entity_ck/src/entities/user_list_joining.rs index ded20d7..3ce618b 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_list_joining.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_list_joining.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_note_pining.rs b/ext_calckey_model/entity_ck/src/entities/user_note_pining.rs index a8c46c9..32747a3 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_note_pining.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_note_pining.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_pending.rs b/ext_calckey_model/entity_ck/src/entities/user_pending.rs index 192b485..6201eeb 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_pending.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_pending.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_profile.rs b/ext_calckey_model/entity_ck/src/entities/user_profile.rs index c91f790..7db836b 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_profile.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_profile.rs @@ -1,6 +1,7 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use super::sea_orm_active_enums::UserProfileFfvisibilityEnum; +use super::sea_orm_active_enums::UserProfileMutingnotificationtypesEnum; use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -12,6 +13,7 @@ pub struct Model { pub location: Option, pub birthday: Option, pub description: Option, + #[sea_orm(column_type = "JsonBinary")] pub fields: Json, pub url: Option, pub email: Option, @@ -26,7 +28,7 @@ pub struct Model { #[sea_orm(column_name = "twoFactorEnabled")] pub two_factor_enabled: bool, pub password: Option, - #[sea_orm(column_name = "clientData")] + #[sea_orm(column_name = "clientData", column_type = "JsonBinary")] pub client_data: Json, #[sea_orm(column_name = "autoAcceptFollowed")] pub auto_accept_followed: bool, @@ -42,24 +44,26 @@ pub struct Model { pub use_password_less_login: bool, #[sea_orm(column_name = "pinnedPageId", unique)] pub pinned_page_id: Option, + #[sea_orm(column_type = "JsonBinary")] pub room: Json, + #[sea_orm(column_type = "JsonBinary")] pub integrations: Json, #[sea_orm(column_name = "injectFeaturedNote")] pub inject_featured_note: bool, #[sea_orm(column_name = "enableWordMute")] pub enable_word_mute: bool, - #[sea_orm(column_name = "mutedWords")] + #[sea_orm(column_name = "mutedWords", column_type = "JsonBinary")] pub muted_words: Json, #[sea_orm(column_name = "mutingNotificationTypes")] - pub muting_notification_types: Vec, + pub muting_notification_types: Vec, #[sea_orm(column_name = "noCrawle")] pub no_crawle: bool, #[sea_orm(column_name = "receiveAnnouncementEmail")] pub receive_announcement_email: bool, - #[sea_orm(column_name = "emailNotificationTypes")] + #[sea_orm(column_name = "emailNotificationTypes", column_type = "JsonBinary")] pub email_notification_types: Json, pub lang: Option, - #[sea_orm(column_name = "mutedInstances")] + #[sea_orm(column_name = "mutedInstances", column_type = "JsonBinary")] pub muted_instances: Json, #[sea_orm(column_name = "publicReactions")] pub public_reactions: bool, diff --git a/ext_calckey_model/entity_ck/src/entities/user_publickey.rs b/ext_calckey_model/entity_ck/src/entities/user_publickey.rs index 608bdcd..072d2bb 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_publickey.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_publickey.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/user_security_key.rs b/ext_calckey_model/entity_ck/src/entities/user_security_key.rs index e18c5d8..66ace7f 100644 --- a/ext_calckey_model/entity_ck/src/entities/user_security_key.rs +++ b/ext_calckey_model/entity_ck/src/entities/user_security_key.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/entity_ck/src/entities/webhook.rs b/ext_calckey_model/entity_ck/src/entities/webhook.rs index 4a0354c..9b5f5df 100644 --- a/ext_calckey_model/entity_ck/src/entities/webhook.rs +++ b/ext_calckey_model/entity_ck/src/entities/webhook.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; diff --git a/ext_calckey_model/migration/src/lib.rs b/ext_calckey_model/migration/src/lib.rs index ffdb201..b952006 100644 --- a/ext_calckey_model/migration/src/lib.rs +++ b/ext_calckey_model/migration/src/lib.rs @@ -2,6 +2,7 @@ pub use sea_orm_migration::prelude::*; mod m20220101_000001_bootstrap; mod m20230729_201733_drop_messaging_integrations; +mod m20230729_212237_user_unique_idx; pub struct Migrator; @@ -11,6 +12,7 @@ impl MigratorTrait for Migrator { vec![ Box::new(m20220101_000001_bootstrap::Migration), Box::new(m20230729_201733_drop_messaging_integrations::Migration), + Box::new(m20230729_212237_user_unique_idx::Migration), ] } } diff --git a/ext_calckey_model/migration/src/m20230729_212237_user_unique_idx.rs b/ext_calckey_model/migration/src/m20230729_212237_user_unique_idx.rs new file mode 100644 index 0000000..e5f1e39 --- /dev/null +++ b/ext_calckey_model/migration/src/m20230729_212237_user_unique_idx.rs @@ -0,0 +1,41 @@ +use sea_orm_migration::prelude::*; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + let db = manager.get_connection(); + + db.execute_unprepared( + r#" + ALTER TABLE "user_keypair" ADD CONSTRAINT "REL_f4853eb41ab722fe05f81cedeb6" UNIQUE ("userId"); + ALTER TABLE "user_profile" ADD CONSTRAINT "REL_51cb79b5555effaf7d69ba1cff9" UNIQUE ("userId"); + ALTER TABLE "user_publickey" ADD CONSTRAINT "REL_10c146e4b39b443ede016f6736d" UNIQUE ("userId"); + ALTER TABLE "poll" ADD CONSTRAINT "REL_da851e06d0dfe2ef397d8b1bf1b" UNIQUE ("noteId"); + ALTER TABLE "promo_note" ADD CONSTRAINT "REL_e263909ca4fe5d57f8d4230dd5c" UNIQUE ("noteId"); + "#, + ) + .await?; + + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + let db = manager.get_connection(); + + db.execute_unprepared( + r#" + ALTER TABLE "user_keypair" DROP CONSTRAINT "REL_f4853eb41ab722fe05f81cedeb6"; + ALTER TABLE "user_profile" DROP CONSTRAINT "REL_51cb79b5555effaf7d69ba1cff9"; + ALTER TABLE "user_publickey" DROP CONSTRAINT "REL_10c146e4b39b443ede016f6736d"; + ALTER TABLE "poll" DROP CONSTRAINT "REL_da851e06d0dfe2ef397d8b1bf1b"; + ALTER TABLE "promo_note" DROP CONSTRAINT "REL_e263909ca4fe5d57f8d4230dd5c"; + "#, + ) + .await?; + + Ok(()) + } +}