fixed #456 - postgres field type mismatch

This commit is contained in:
Eugene Pankov 2022-11-08 11:48:24 +01:00
parent 4d8dea08a7
commit 022900be5a
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
6 changed files with 7 additions and 5 deletions

2
.gitignore vendored
View file

@ -16,7 +16,9 @@ host_key*
# ---
data
data-*
config.*.yaml
config.yaml
__pycache__
.pytest_cache
dhat-heap.json

View file

@ -10,7 +10,7 @@ pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub host: String,
pub port: u16,
pub port: i32,
pub key_type: String,
pub key_base64: String,
}

View file

@ -14,7 +14,7 @@ pub struct Model {
pub secret: String,
pub username: String,
pub target: String,
pub uses_left: Option<u32>,
pub uses_left: Option<i32>,
pub expiry: Option<DateTime<Utc>>,
pub created: DateTime<Utc>,
}

View file

@ -13,7 +13,7 @@ pub mod ticket {
pub secret: String,
pub username: String,
pub target: String,
pub uses_left: Option<u32>,
pub uses_left: Option<i16>,
pub expiry: Option<DateTimeUtc>,
pub created: DateTimeUtc,
}

View file

@ -11,7 +11,7 @@ pub mod known_host {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub host: String,
pub port: u16,
pub port: i32,
pub key_type: String,
pub key_base64: String,
}

View file

@ -63,7 +63,7 @@ impl KnownHosts {
let values = KnownHost::ActiveModel {
id: Set(Uuid::new_v4()),
host: Set(host.to_owned()),
port: Set(port),
port: Set(port.into()),
key_type: Set(key.name().to_owned()),
key_base64: Set(key.public_key_base64()),
};