fix: change BIGINT UNSIGNED to BIGINT, INT columns map to i32 not i64

This commit is contained in:
NixReaper
2026-04-25 20:59:41 -05:00
parent 144d08a581
commit 09b043d764
2 changed files with 63 additions and 63 deletions
+6 -6
View File
@@ -11,8 +11,8 @@ pub struct Account {
pub domain: String,
pub email: String,
pub package_name: String,
pub disk_quota_mb: i64,
pub bandwidth_mb: i64,
pub disk_quota_mb: i32, // INT column → i32
pub bandwidth_mb: i32, // INT column → i32
pub status: String,
pub created_at: NaiveDateTime,
}
@@ -24,8 +24,8 @@ pub struct CreateAccountRequest {
pub email: String,
pub password: String,
pub package_name: Option<String>,
pub disk_quota_mb: Option<i64>,
pub bandwidth_mb: Option<i64>,
pub disk_quota_mb: Option<i32>,
pub bandwidth_mb: Option<i32>,
}
pub async fn list_accounts(
@@ -71,8 +71,8 @@ pub async fn create_account(
let _ = std::fs::create_dir_all(format!("/home/{}/public_html", body.username));
let package_name = body.package_name.unwrap_or_else(|| "Default".into());
let disk_quota_mb = body.disk_quota_mb.unwrap_or(10240);
let bandwidth_mb = body.bandwidth_mb.unwrap_or(0);
let disk_quota_mb: i32 = body.disk_quota_mb.unwrap_or(10240);
let bandwidth_mb: i32 = body.bandwidth_mb.unwrap_or(0);
let insert_id: u64 = sqlx::query(
"INSERT INTO accounts (username, domain, email, password_hash, package_name, disk_quota_mb, bandwidth_mb, status)