swap u64 for PgU64 in some files
This commit is contained in:
parent
f66dff446b
commit
ce67efe93c
|
@ -3,6 +3,8 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
use sqlx_pg_uint::PgU64;
|
||||||
|
|
||||||
use crate::types::utils::Snowflake;
|
use crate::types::utils::Snowflake;
|
||||||
|
|
||||||
|
@ -16,11 +18,20 @@ pub struct Attachment {
|
||||||
/// Max 1024 characters
|
/// Max 1024 characters
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
pub content_type: Option<String>,
|
pub content_type: Option<String>,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub size: u64,
|
pub size: u64,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub size: PgU64,
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub proxy_url: String,
|
pub proxy_url: String,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub height: Option<u64>,
|
pub height: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub height: Option<PgU64>,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub width: Option<u64>,
|
pub width: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub width: Option<PgU64>,
|
||||||
pub ephemeral: Option<bool>,
|
pub ephemeral: Option<bool>,
|
||||||
/// The duration of the audio file (only for voice messages)
|
/// The duration of the audio file (only for voice messages)
|
||||||
pub duration_secs: Option<f32>,
|
pub duration_secs: Option<f32>,
|
||||||
|
@ -42,7 +53,10 @@ pub struct PartialDiscordFileAttachment {
|
||||||
/// Max 1024 characters
|
/// Max 1024 characters
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
pub content_type: Option<String>,
|
pub content_type: Option<String>,
|
||||||
pub size: Option<i64>,
|
#[cfg(not(feature = "sqlx"))]
|
||||||
|
pub size: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub size: Option<PgU64>,
|
||||||
pub url: Option<String>,
|
pub url: Option<String>,
|
||||||
pub proxy_url: Option<String>,
|
pub proxy_url: Option<String>,
|
||||||
pub height: Option<i32>,
|
pub height: Option<i32>,
|
||||||
|
|
|
@ -7,6 +7,8 @@ use super::option_vec_arc_rwlock_ptr_eq;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
use sqlx_pg_uint::PgU64;
|
||||||
|
|
||||||
use crate::types::utils::Snowflake;
|
use crate::types::utils::Snowflake;
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
|
@ -251,16 +253,28 @@ pub struct AuditEntryInfo {
|
||||||
pub auto_moderation_rule_trigger_type: Option<AutoModerationRuleTriggerType>,
|
pub auto_moderation_rule_trigger_type: Option<AutoModerationRuleTriggerType>,
|
||||||
pub channel_id: Option<Snowflake>,
|
pub channel_id: Option<Snowflake>,
|
||||||
// #[serde(option_string)]
|
// #[serde(option_string)]
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub count: Option<u64>,
|
pub count: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub count: Option<PgU64>,
|
||||||
// #[serde(option_string)]
|
// #[serde(option_string)]
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub delete_member_days: Option<u64>,
|
pub delete_member_days: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub delete_member_days: Option<PgU64>,
|
||||||
/// The ID of the overwritten entity
|
/// The ID of the overwritten entity
|
||||||
pub id: Option<Snowflake>,
|
pub id: Option<Snowflake>,
|
||||||
pub integration_type: Option<IntegrationType>,
|
pub integration_type: Option<IntegrationType>,
|
||||||
// #[serde(option_string)]
|
// #[serde(option_string)]
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub members_removed: Option<u64>,
|
pub members_removed: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub members_removed: Option<PgU64>,
|
||||||
// #[serde(option_string)]
|
// #[serde(option_string)]
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub message_id: Option<u64>,
|
pub message_id: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub message_id: Option<PgU64>,
|
||||||
pub role_name: Option<String>,
|
pub role_name: Option<String>,
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub overwrite_type: Option<PermissionOverwriteType>,
|
pub overwrite_type: Option<PermissionOverwriteType>,
|
||||||
|
|
|
@ -293,7 +293,10 @@ pub struct ThreadMember {
|
||||||
pub id: Option<Snowflake>,
|
pub id: Option<Snowflake>,
|
||||||
pub user_id: Option<Snowflake>,
|
pub user_id: Option<Snowflake>,
|
||||||
pub join_timestamp: Option<DateTime<Utc>>,
|
pub join_timestamp: Option<DateTime<Utc>>,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub flags: Option<u64>,
|
pub flags: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub flags: Option<sqlx_pg_uint::PgU64>,
|
||||||
pub member: Option<Shared<GuildMember>>,
|
pub member: Option<Shared<GuildMember>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,10 @@ pub struct GuildScheduledEvent {
|
||||||
pub entity_id: Option<Snowflake>,
|
pub entity_id: Option<Snowflake>,
|
||||||
pub entity_metadata: Option<GuildScheduledEventEntityMetadata>,
|
pub entity_metadata: Option<GuildScheduledEventEntityMetadata>,
|
||||||
pub creator: Option<Shared<User>>,
|
pub creator: Option<Shared<User>>,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub user_count: Option<u64>,
|
pub user_count: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub user_count: Option<sqlx_pg_uint::PgU64>,
|
||||||
pub image: Option<String>,
|
pub image: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,10 @@ pub struct SecurityKey {
|
||||||
pub user_id: String,
|
pub user_id: String,
|
||||||
pub key_id: String,
|
pub key_id: String,
|
||||||
pub public_key: String,
|
pub public_key: String,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub counter: u64,
|
pub counter: u64,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub counter: sqlx_pg_uint::PgU64,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +27,10 @@ impl Default for SecurityKey {
|
||||||
user_id: String::new(),
|
user_id: String::new(),
|
||||||
key_id: String::new(),
|
key_id: String::new(),
|
||||||
public_key: String::new(),
|
public_key: String::new(),
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
counter: 0,
|
counter: 0,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
counter: sqlx_pg_uint::PgU64::from(0),
|
||||||
name: String::new(),
|
name: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,9 @@ use chrono::{DateTime, Utc};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
Shared,
|
|
||||||
entities::{Guild, User},
|
entities::{Guild, User},
|
||||||
utils::Snowflake,
|
utils::Snowflake,
|
||||||
|
Shared,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// See <https://docs.spacebar.chat/routes/#cmp--schemas-template>
|
/// See <https://docs.spacebar.chat/routes/#cmp--schemas-template>
|
||||||
|
@ -18,7 +18,10 @@ pub struct GuildTemplate {
|
||||||
pub code: String,
|
pub code: String,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
|
#[cfg(not(feature = "sqlx"))]
|
||||||
pub usage_count: Option<u64>,
|
pub usage_count: Option<u64>,
|
||||||
|
#[cfg(feature = "sqlx")]
|
||||||
|
pub usage_count: Option<sqlx_pg_uint::PgU64>,
|
||||||
pub creator_id: Snowflake,
|
pub creator_id: Snowflake,
|
||||||
#[cfg_attr(feature = "sqlx", sqlx(skip))]
|
#[cfg_attr(feature = "sqlx", sqlx(skip))]
|
||||||
pub creator: Shared<User>,
|
pub creator: Shared<User>,
|
||||||
|
|
Loading…
Reference in New Issue