mirror of
https://github.com/warp-tech/warpgate.git
synced 2024-11-10 09:12:56 +08:00
fixed #857 - fixed default ticket expiry on MySQL, bumped sea-orm
This commit is contained in:
parent
d9385ca44b
commit
aca8d3d515
10 changed files with 552 additions and 272 deletions
794
Cargo.lock
generated
794
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,7 @@ poem-openapi = { version = "2.0", features = [
|
|||
russh-keys = { version = "0.37.1", features = ["openssl"] }
|
||||
# russh-keys = { version = "0.23.0-beta.1", features = ["openssl"], path = "../../russh/russh-keys" }
|
||||
rust-embed = "6.3"
|
||||
sea-orm = { version = "0.11.2", features = [
|
||||
sea-orm = { version = "0.12.2", features = [
|
||||
"runtime-tokio-native-tls",
|
||||
"macros",
|
||||
], default-features = false }
|
||||
|
|
|
@ -84,6 +84,7 @@ impl Api {
|
|||
username: Set(body.username.clone()),
|
||||
target: Set(body.target_name.clone()),
|
||||
created: Set(chrono::Utc::now()),
|
||||
expiry: Set(None),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ poem-openapi = { version = "2.0", features = [
|
|||
rand = "0.8"
|
||||
rand_chacha = "0.3"
|
||||
rand_core = { version = "0.6", features = ["std"] }
|
||||
sea-orm = { version = "0.11.2", features = [
|
||||
sea-orm = { version = "0.12.2", features = [
|
||||
"runtime-tokio-native-tls",
|
||||
"macros",
|
||||
], default-features = false }
|
||||
|
|
|
@ -30,7 +30,7 @@ poem-openapi = { version = "2.0", features = [
|
|||
rand = "0.8"
|
||||
rand_chacha = "0.3"
|
||||
rand_core = { version = "0.6", features = ["std"] }
|
||||
sea-orm = { version = "0.11.2", features = [
|
||||
sea-orm = { version = "0.12.2", features = [
|
||||
"runtime-tokio-native-tls",
|
||||
"macros",
|
||||
], default-features = false }
|
||||
|
|
|
@ -7,7 +7,7 @@ version = "0.7.4"
|
|||
[dependencies]
|
||||
chrono = { version = "0.4", default_features = false, features = ["serde"] }
|
||||
poem-openapi = { version = "2.0", features = ["chrono", "uuid"] }
|
||||
sea-orm = { version = "0.11.2", features = [
|
||||
sea-orm = { version = "0.12.2", features = [
|
||||
"macros",
|
||||
"with-chrono",
|
||||
"with-uuid",
|
||||
|
|
|
@ -10,14 +10,14 @@ version = "0.7.4"
|
|||
[dependencies]
|
||||
async-std = { version = "^1.11", features = ["attributes"] }
|
||||
chrono = { version = "0.4", default_features = false, features = ["serde"] }
|
||||
sea-orm = { version = "0.11.2", features = [
|
||||
sea-orm = { version = "0.12.2", features = [
|
||||
"runtime-tokio-native-tls",
|
||||
"macros",
|
||||
"with-chrono",
|
||||
"with-uuid",
|
||||
"with-json",
|
||||
], default-features = false }
|
||||
sea-orm-migration = { version = "0.11.2", default-features = false, features = [
|
||||
sea-orm-migration = { version = "0.12.2", default-features = false, features = [
|
||||
"cli",
|
||||
] }
|
||||
uuid = { version = "1.2", features = ["v4", "serde"] }
|
||||
|
|
|
@ -37,9 +37,20 @@ impl MigrationTrait for Migration {
|
|||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
let builder = manager.get_database_backend();
|
||||
let schema = Schema::new(builder);
|
||||
|
||||
manager
|
||||
.create_table(schema.create_table_from_entity(ticket::Entity))
|
||||
.await
|
||||
.await?;
|
||||
|
||||
// https://github.com/warp-tech/warpgate/issues/857
|
||||
let _ = manager
|
||||
.get_connection()
|
||||
.execute_unprepared(
|
||||
"ALTER TABLE `tickets` MODIFY COLUMN `expiry` TIMESTAMP NULL DEFAULT NULL",
|
||||
)
|
||||
.await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
|
|
|
@ -16,7 +16,7 @@ russh = { version = "0.37.1", features = ["vendored-openssl"] }
|
|||
# russh = { version = "0.35.0-beta.6", features = ["vendored-openssl"], path = "../../russh/russh"}
|
||||
russh-keys = { version = "0.37.1", features = ["vendored-openssl"] }
|
||||
# russh-keys = { version = "0.23.0-beta.1", features = ["vendored-openssl"], path = "../../russh/russh-keys" }
|
||||
sea-orm = { version = "0.11.2", features = [
|
||||
sea-orm = { version = "0.12.2", features = [
|
||||
"runtime-tokio-native-tls",
|
||||
], default-features = false }
|
||||
thiserror = "1.0"
|
||||
|
|
|
@ -21,7 +21,7 @@ notify = "^5.0.0"
|
|||
rcgen = { version = "0.10", features = ["zeroize"] }
|
||||
serde_json = "1.0"
|
||||
serde_yaml = "0.8.23"
|
||||
sea-orm = { version = "0.11.2", default-features = false }
|
||||
sea-orm = { version = "0.12.2", default-features = false }
|
||||
time = "0.3"
|
||||
tokio = { version = "1.20", features = ["tracing", "signal", "macros"] }
|
||||
tracing = "0.1"
|
||||
|
|
Loading…
Reference in a new issue