diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 428d439d..1ca17eab 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - [[package]] name = "addr2line" version = "0.21.0" @@ -67,6 +61,54 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.71" @@ -310,7 +352,7 @@ dependencies = [ "prost-types", "quick_cache", "ring 0.17.5", - "sea-orm 0.12.6", + "sea-orm", "serde", "spin 0.9.8", "thiserror", @@ -340,19 +382,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "bae" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b8de67cc41132507eeece2584804efcb15f85ba516e34c944b7667f480397a" -dependencies = [ - "heck 0.3.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "base64" version = "0.21.5" @@ -560,39 +589,49 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ - "bitflags 1.3.2", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "indexmap 1.9.3", - "once_cell", - "textwrap", + "strsim", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ - "heck 0.4.1", - "proc-macro-error", + "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.32", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "concurrent-queue" @@ -609,6 +648,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -808,7 +857,7 @@ name = "entity" version = "0.1.0" dependencies = [ "bincode", - "sea-orm 0.12.6", + "sea-orm", "serde", ] @@ -818,7 +867,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 2.0.32", @@ -907,6 +956,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1064,6 +1128,12 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "gloo-timers" version = "0.2.6" @@ -1128,15 +1198,6 @@ dependencies = [ "hashbrown 0.13.2", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -1544,9 +1605,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] @@ -1601,7 +1662,11 @@ name = "migration" version = "0.1.0" dependencies = [ "async-std", + "log", + "sea-orm", "sea-orm-migration", + "tracing", + "tracing-subscriber", ] [[package]] @@ -1642,6 +1707,24 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nom" version = "7.1.1" @@ -1747,52 +1830,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "ordered-float" -version = "3.7.0" +name = "openssl" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ - "num-traits", + "bitflags 2.3.3", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", ] [[package]] -name = "os_str_bytes" -version = "6.6.1" +name = "openssl-macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] [[package]] -name = "ouroboros" -version = "0.15.6" +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ - "aliasable", - "ouroboros_macro 0.15.6", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] -name = "ouroboros" -version = "0.17.2" +name = "ordered-float" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" +checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" dependencies = [ - "aliasable", - "ouroboros_macro 0.17.2", - "static_assertions", + "num-traits", ] [[package]] -name = "ouroboros_macro" -version = "0.15.6" +name = "ouroboros" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" dependencies = [ - "Inflector", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "aliasable", + "ouroboros_macro", + "static_assertions", ] [[package]] @@ -1801,7 +1899,7 @@ version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro-error", "proc-macro2", "quote", @@ -2033,7 +2131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", - "heck 0.4.1", + "heck", "itertools", "log", "multimap", @@ -2379,6 +2477,15 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -2401,33 +2508,13 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bd3534a9978d0aa7edd2808dc1f8f31c4d0ecd31ddf71d997b3c98e9f3c9114" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.32", ] -[[package]] -name = "sea-orm" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fade86e8d41fd1a4721f84cb834f4ca2783f973cc30e6212b7fafc134f169214" -dependencies = [ - "async-stream", - "async-trait", - "futures", - "log", - "ouroboros 0.15.6", - "sea-orm-macros 0.11.3", - "sea-query 0.28.5", - "sea-strum", - "serde", - "thiserror", - "tracing", - "url", -] - [[package]] name = "sea-orm" version = "0.12.6" @@ -2440,10 +2527,10 @@ dependencies = [ "chrono", "futures", "log", - "ouroboros 0.17.2", + "ouroboros", "rust_decimal", - "sea-orm-macros 0.12.6", - "sea-query 0.30.2", + "sea-orm-macros", + "sea-query", "sea-query-binder", "serde", "serde_json", @@ -2458,13 +2545,14 @@ dependencies = [ [[package]] name = "sea-orm-cli" -version = "0.11.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbf34a2caf70c2e3be9bb1e674e9540f6dfd7c8f40f6f05daf3b9740e476005" +checksum = "507c2b99f83129f4d5d511012ab47c9f40d1c7923fd4698c19fae23f0bf62913" dependencies = [ "chrono", "clap", "dotenvy", + "glob", "regex", "sea-schema", "tracing", @@ -2472,26 +2560,13 @@ dependencies = [ "url", ] -[[package]] -name = "sea-orm-macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28936f26d62234ff0be16f80115dbdeb3237fe9c25cf18fbcd1e3b3592360f20" -dependencies = [ - "bae", - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sea-orm-macros" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "816183a751bf9c22087679b20b6142da0b5c6d8981835ebb7b99bf1bf924640a" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "sea-bae", @@ -2501,30 +2576,21 @@ dependencies = [ [[package]] name = "sea-orm-migration" -version = "0.11.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278d3adfd0832b6ffc17d3cfbc574d3695a5c1b38814e0bc8ac238d33f3d87cf" +checksum = "9d45937e5d4869a0dcf0222bb264df564c077cbe9b312265f3717401d023a633" dependencies = [ "async-trait", "clap", "dotenvy", "futures", - "sea-orm 0.11.3", + "sea-orm", "sea-orm-cli", "sea-schema", "tracing", "tracing-subscriber", ] -[[package]] -name = "sea-query" -version = "0.28.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbab99b8cd878ab7786157b7eb8df96333a6807cc6e45e8888c85b51534b401a" -dependencies = [ - "sea-query-derive", -] - [[package]] name = "sea-query" version = "0.30.2" @@ -2537,6 +2603,7 @@ dependencies = [ "inherent", "ordered-float", "rust_decimal", + "sea-query-derive", "serde_json", "time", "uuid", @@ -2551,7 +2618,7 @@ dependencies = [ "bigdecimal", "chrono", "rust_decimal", - "sea-query 0.30.2", + "sea-query", "serde_json", "sqlx", "time", @@ -2560,67 +2627,68 @@ dependencies = [ [[package]] name = "sea-query-derive" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f62030c60f3a691f5fe251713b4e220b306e50a71e1d6f9cce1f24bb781978" +checksum = "25a82fcb49253abcb45cdcb2adf92956060ec0928635eb21b4f7a6d8f25ab0bc" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.32", "thiserror", ] [[package]] name = "sea-schema" -version = "0.11.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb2940bb5a10bc6cd05b450ce6cd3993e27fddd7eface2becb97fc5af3a040e" +checksum = "0cd9561232bd1b82ea748b581f15909d11de0db6563ddcf28c5d908aee8282f1" dependencies = [ "futures", - "sea-query 0.28.5", + "sea-query", "sea-schema-derive", ] [[package]] name = "sea-schema-derive" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56821b7076f5096b8f726e2791ad255a99c82498e08ec477a65a96c461ff1927" +checksum = "c6f686050f76bffc4f635cda8aea6df5548666b830b52387e8bc7de11056d11e" dependencies = [ - "heck 0.3.3", + "heck", "proc-macro2", "quote", "syn 1.0.109", ] [[package]] -name = "sea-strum" -version = "0.23.0" +name = "seahash" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391d06a6007842cfe79ac6f7f53911b76dfd69fc9a6769f1cf6569d12ce20e1b" -dependencies = [ - "sea-strum_macros", -] +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] -name = "sea-strum_macros" -version = "0.23.0" +name = "security-framework" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b4397b825df6ccf1e98bcdabef3bbcfc47ff5853983467850eeab878384f21" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] -name = "seahash" -version = "4.1.0" +name = "security-framework-sys" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] name = "serde" @@ -2826,6 +2894,7 @@ dependencies = [ "indexmap 2.0.0", "log", "memchr", + "native-tls", "once_cell", "paste", "percent-encoding", @@ -2868,7 +2937,7 @@ checksum = "8a4a8336d278c62231d87f24e8a7a74898156e34c1c18942857be2acb29c7dfc" dependencies = [ "dotenvy", "either", - "heck 0.4.1", + "heck", "hex", "once_cell", "proc-macro2", @@ -3084,12 +3153,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" version = "1.0.44" @@ -3537,6 +3600,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.5.0" @@ -3777,6 +3846,15 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -3807,6 +3885,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3819,6 +3912,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -3831,6 +3930,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -3843,6 +3948,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -3855,6 +3966,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -3867,6 +3984,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -3879,6 +4002,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -3891,6 +4020,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.4.6" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index dad7f79b..8ae520e8 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -40,7 +40,7 @@ features =["json"] [dependencies.tracing] version = "0.1.40" -features =["async-await", "log"] +features = ["async-await", "log"] [dependencies.tokio] version = "1.34.0" diff --git a/backend/entity/src/submit.rs b/backend/entity/src/submit.rs index a3926d2c..3ce7c380 100644 --- a/backend/entity/src/submit.rs +++ b/backend/entity/src/submit.rs @@ -15,7 +15,7 @@ pub struct Model { pub upload_at: DateTime, #[sea_orm(nullable, indexed)] pub time: Option, - #[sea_orm(nullable)] + #[sea_orm(nullable)] pub accuracy: Option, #[sea_orm(default_value = "false")] pub committed: bool, diff --git a/backend/entity/src/user.rs b/backend/entity/src/user.rs index d301bf6b..96ff5272 100644 --- a/backend/entity/src/user.rs +++ b/backend/entity/src/user.rs @@ -9,7 +9,7 @@ pub struct Model { #[sea_orm(primary_key, auto_increment = true)] pub id: i32, pub permission: u64, - #[sea_orm(indexed, default_value="0")] + #[sea_orm(indexed, default_value = "0")] pub score: u32, pub username: String, pub password: Vec, diff --git a/backend/justfile b/backend/justfile index 7db7fb92..66a0967d 100644 --- a/backend/justfile +++ b/backend/justfile @@ -7,8 +7,10 @@ prepare: mkdir -p database mkdir -p config + sea-orm-cli migrate -u sqlite://database/backend.sqlite?mode=rwc release-docker: + just prepare cp ../proto/*.proto . cp ../cert/*.pem . docker build . --build-arg ARCH=$(uname -m) -t mdoj-backend diff --git a/backend/migration/Cargo.toml b/backend/migration/Cargo.toml index 22cdf3ed..fab53cd8 100644 --- a/backend/migration/Cargo.toml +++ b/backend/migration/Cargo.toml @@ -9,14 +9,27 @@ name = "migration" path = "src/lib.rs" [dependencies] -async-std = { version = "1", features = ["attributes", "tokio1"] } +log = "0.4.20" +tracing-subscriber = "0.3" + +[dependencies.tracing] +version = "0.1.40" +features = ["async-await", "log"] + +[dependencies.async-std] +version = "1" +features = ["attributes", "tokio1"] + +[dependencies.sea-orm] +version = "0.12.2" +features = ["debug-print"] [dependencies.sea-orm-migration] -version = "0.11.0" +version = "0.12.2" features = [ # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime. # e.g. - # "runtime-tokio-rustls", # `ASYNC_RUNTIME` feature - # "sqlx-postgres", # `DATABASE_DRIVER` feature + "runtime-tokio-native-tls", + "sqlx-sqlite","with-chrono" ] diff --git a/backend/migration/src/m20231207_000001_create_table.rs b/backend/migration/src/m20231207_000001_create_table.rs index 0c1f53ff..0eec1dad 100644 --- a/backend/migration/src/m20231207_000001_create_table.rs +++ b/backend/migration/src/m20231207_000001_create_table.rs @@ -2,6 +2,10 @@ use std::ptr::null; use sea_orm_migration::{prelude::*, seaql_migrations::PrimaryKey}; +// static UPDATE_AT: &str = "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"; +static UPDATE_AT: &str = "DEFAULT CURRENT_TIMESTAMP"; +static CREATE_AT: &str = "DEFAULT CURRENT_TIMESTAMP"; + #[derive(Iden)] enum Announcement { Table, @@ -107,7 +111,6 @@ enum User { #[derive(Iden)] enum UserContest { Table, - Id, UserId, ContestId, Score, @@ -136,12 +139,12 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(Announcement::CreateAt) .not_null() - .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), + .extra(CREATE_AT.to_string()), ) .col( - ColumnDef::new(Announcement::UpdateAt).not_null().extra( - "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP".to_string(), - ), + ColumnDef::new(Announcement::UpdateAt) + .not_null() + .extra(UPDATE_AT.to_string()), ) .to_owned(), ) @@ -159,8 +162,16 @@ impl MigrationTrait for Migration { .primary_key(), ) .col(ColumnDef::new(Contest::Hoster).integer().not_null()) - .col(ColumnDef::new(Contest::Begin).time().not_null()) - .col(ColumnDef::new(Contest::End).time().not_null()) + .col( + ColumnDef::new(Contest::Begin) + .timestamp_with_time_zone() + .not_null(), + ) + .col( + ColumnDef::new(Contest::End) + .timestamp_with_time_zone() + .not_null(), + ) .col(ColumnDef::new(Contest::Title).text().not_null()) .col(ColumnDef::new(Contest::Content).text().default("")) .col(ColumnDef::new(Contest::Tags).text().default("")) @@ -168,12 +179,12 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(Contest::CreateAt) .not_null() - .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), + .extra(CREATE_AT.to_string()), ) .col( - ColumnDef::new(Contest::UpdateAt).not_null().extra( - "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP".to_string(), - ), + ColumnDef::new(Contest::UpdateAt) + .not_null() + .extra(UPDATE_AT.to_string()), ) .col(ColumnDef::new(Contest::Public).boolean().default(false)) .to_owned(), @@ -220,7 +231,8 @@ impl MigrationTrait for Migration { ColumnDef::new(Problem::Id) .integer() .not_null() - .auto_increment(), + .auto_increment() + .primary_key(), ) .col(ColumnDef::new(Problem::UserId).integer().not_null()) .foreign_key( @@ -243,12 +255,12 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(Problem::CreateAt) .not_null() - .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), + .extra(CREATE_AT.to_string()), ) .col( - ColumnDef::new(Problem::UpdateAt).not_null().extra( - "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP".to_string(), - ), + ColumnDef::new(Problem::UpdateAt) + .not_null() + .extra(UPDATE_AT.to_string()), ) .col(ColumnDef::new(Problem::MatchRule).integer().not_null()) .to_owned(), @@ -262,9 +274,9 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(Submit::Id) .integer() - .primary_key() + .not_null() .auto_increment() - .not_null(), + .primary_key(), ) .col(ColumnDef::new(Submit::UserId).integer().null()) .foreign_key( @@ -283,7 +295,7 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(Submit::UploadAt) .not_null() - .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), + .extra(CREATE_AT.to_string()), ) .col(ColumnDef::new(Submit::Time).big_unsigned().null()) .col(ColumnDef::new(Submit::Accuracy).big_unsigned().null()) @@ -305,10 +317,10 @@ impl MigrationTrait for Migration { .if_not_exists() .col( ColumnDef::new(Test::Id) - .primary_key() + .integer() .not_null() .auto_increment() - .integer(), + .primary_key(), ) .col(ColumnDef::new(Test::UserId).integer().not_null()) .foreign_key( @@ -337,10 +349,10 @@ impl MigrationTrait for Migration { .if_not_exists() .col( ColumnDef::new(Token::Id) - .primary_key() + .integer() .not_null() .auto_increment() - .integer(), + .primary_key(), ) .col(ColumnDef::new(Token::UserId).integer().not_null()) .foreign_key( @@ -351,7 +363,11 @@ impl MigrationTrait for Migration { ) .col(ColumnDef::new(Token::Rand).binary().not_null()) .col(ColumnDef::new(Token::Permission).big_unsigned().default(0)) - .col(ColumnDef::new(Token::Expiry).time().not_null()) + .col( + ColumnDef::new(Token::Expiry) + .timestamp_with_time_zone() + .not_null(), + ) .to_owned(), ) .await?; @@ -362,10 +378,10 @@ impl MigrationTrait for Migration { .if_not_exists() .col( ColumnDef::new(User::Id) + .integer() .not_null() - .primary_key() .auto_increment() - .integer(), + .primary_key(), ) .col(ColumnDef::new(User::Permission).big_unsigned().default(0)) .col(ColumnDef::new(User::Score).unsigned().default(0)) @@ -374,7 +390,7 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(User::CreateAt) .not_null() - .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), + .extra(CREATE_AT.to_string()), ) .to_owned(), ) @@ -398,6 +414,7 @@ impl MigrationTrait for Migration { .from(UserContest::Table, UserContest::UserId) .to(User::Table, User::Id), ) + .col(ColumnDef::new(UserContest::Score).integer().default(0)) .to_owned(), ) .await?; diff --git a/backend/src/controller/judger/route/mod.rs b/backend/src/controller/judger/route/mod.rs index 3d7020be..bfc4d24d 100644 --- a/backend/src/controller/judger/route/mod.rs +++ b/backend/src/controller/judger/route/mod.rs @@ -98,9 +98,7 @@ impl std::ops::Deref for ConnGuard { impl Drop for ConnGuard { fn drop(&mut self) { self.upstream.healthy.fetch_add(-2, Ordering::Acquire); - self.upstream - .clients - .push(self.conn.take().unwrap()); + self.upstream.clients.push(self.conn.take().unwrap()); } } @@ -172,8 +170,10 @@ impl Router { Ok(self_) } pub async fn get(&self, lang: &Uuid) -> Result { - - let queue = self.routing_table.get(lang).ok_or(Error::BadArgument("lang"))?; + let queue = self + .routing_table + .get(lang) + .ok_or(Error::BadArgument("lang"))?; loop { match queue.pop() { diff --git a/backend/src/init/db.rs b/backend/src/init/db.rs index 2c705e24..350b701a 100644 --- a/backend/src/init/db.rs +++ b/backend/src/init/db.rs @@ -50,7 +50,7 @@ async fn create_table(db: &DatabaseConnection, entity: E) where E: EntityTrait, { - log::info!("Creating table: {}",entity.table_name()); + log::info!("Creating table: {}", entity.table_name()); let builder = db.get_database_backend(); let stmt = builder.build( Schema::new(builder) diff --git a/backend/src/main.rs b/backend/src/main.rs index c6040edf..485d8ff1 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -11,4 +11,3 @@ async fn main() { log::info!("starting server"); server::Server::start().await; } - \ No newline at end of file