change: Rename UserId to IdCol and make it private

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-07-28 10:40:04 +03:00
parent 0274444434
commit f0383296de
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F
5 changed files with 8 additions and 8 deletions

View file

@ -31,8 +31,8 @@ use crate::prelude::*;
#[sea_orm(table_name = "incoming_chat")] #[sea_orm(table_name = "incoming_chat")]
pub struct Model { pub struct Model {
#[sea_orm(primary_key)] #[sea_orm(primary_key)]
pub id: UserId, pub id: IdCol,
pub recipient_id: UserId, pub recipient_id: IdCol,
/// Public key of the sender /// Public key of the sender
pub sender: PublicKey, pub sender: PublicKey,
/// The timestamp of the request, when it was received /// The timestamp of the request, when it was received

View file

@ -31,8 +31,8 @@ use crate::prelude::*;
#[sea_orm(table_name = "out_chat_requests")] #[sea_orm(table_name = "out_chat_requests")]
pub struct Model { pub struct Model {
#[sea_orm(primary_key)] #[sea_orm(primary_key)]
pub id: UserId, pub id: IdCol,
pub sender_id: UserId, pub sender_id: IdCol,
/// Public key of the recipient /// Public key of the recipient
pub recipient: PublicKey, pub recipient: PublicKey,
/// The timestamp of the request, when it was sent /// The timestamp of the request, when it was sent

View file

@ -38,7 +38,7 @@ pub use sea_orm::{
}; };
/// User ID type /// User ID type
pub type UserId = i64; pub(crate) type IdCol = i64;
pub use super::incoming_chat::{ pub use super::incoming_chat::{
ActiveModel as IncomingChatActiveModel, ActiveModel as IncomingChatActiveModel,

View file

@ -31,7 +31,7 @@ use crate::prelude::*;
#[sea_orm(table_name = "users")] #[sea_orm(table_name = "users")]
pub struct Model { pub struct Model {
#[sea_orm(primary_key)] #[sea_orm(primary_key)]
pub id: UserId, pub id: IdCol,
pub public_key: PublicKey, pub public_key: PublicKey,
pub last_logout: chrono::DateTime<Utc>, pub last_logout: chrono::DateTime<Utc>,
pub is_admin: bool, pub is_admin: bool,

View file

@ -40,8 +40,8 @@ pub enum AccessStatus {
#[sea_orm(table_name = "users_status")] #[sea_orm(table_name = "users_status")]
pub struct Model { pub struct Model {
#[sea_orm(primary_key)] #[sea_orm(primary_key)]
pub id: UserId, pub id: IdCol,
pub user_id: UserId, pub user_id: IdCol,
pub target: PublicKey, pub target: PublicKey,
pub status: AccessStatus, pub status: AccessStatus,
pub updated_at: chrono::DateTime<Utc>, pub updated_at: chrono::DateTime<Utc>,