diff --git a/Cargo.lock b/Cargo.lock index 116ee5b..0ab7858 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,7 +115,7 @@ dependencies = [ "log", "pin-project-lite", "tokio", - "tokio-rustls 0.23.3", + "tokio-rustls 0.23.4", "tungstenite", "webpki-roots 0.22.3", ] @@ -202,15 +202,6 @@ dependencies = [ "generic-array 0.12.4", ] -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array 0.14.5", -] - [[package]] name = "block-buffer" version = "0.10.2" @@ -354,7 +345,7 @@ dependencies = [ "hmac", "percent-encoding", "rand 0.8.5", - "sha2 0.10.2", + "sha2", "subtle", "time 0.3.9", "version_check", @@ -495,13 +486,13 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.2.0" +version = "5.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8858831f7781322e539ea39e72449c46b059638250c14344fec8d0aa6e539c" +checksum = "391b56fbd302e585b7a9494fb70e40949567b1cf9003a8e4a6041a1687c26573" dependencies = [ "cfg-if 1.0.0", - "num_cpus", - "parking_lot 0.12.0", + "hashbrown 0.12.1", + "lock_api", "serde", ] @@ -575,15 +566,6 @@ dependencies = [ "generic-array 0.12.4", ] -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.5", -] - [[package]] name = "digest" version = "0.10.3" @@ -941,7 +923,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.1", + "tokio-util 0.7.2", "tracing", ] @@ -954,13 +936,19 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" + [[package]] name = "hashlink" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -1007,9 +995,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" dependencies = [ "bytes", "fnv", @@ -1029,9 +1017,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6330e8a36bd8c859f3fa6d9382911fbb7147ec39807f63b923933a247240b9ba" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" @@ -1083,9 +1071,9 @@ checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ "http", "hyper", - "rustls 0.20.4", + "rustls 0.20.5", "tokio", - "tokio-rustls 0.23.3", + "tokio-rustls 0.23.4", ] [[package]] @@ -1143,7 +1131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", "serde", ] @@ -1254,9 +1242,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.124" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" +checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" [[package]] name = "libm" @@ -1276,18 +1264,18 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "loom" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc5c7d328e32cc4954e8e01193d7f0ef5ab257b5090b70a964e099a36034309" +checksum = "85eb735cf3c8ebac6cc3655c5da2f4a088b6a19133aa482471a21ba0eb5d83ab" dependencies = [ "cfg-if 1.0.0", "generator", @@ -1321,9 +1309,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" @@ -1369,7 +1357,7 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow 0.2.2", + "miow", "net2", "slab", "winapi 0.2.8", @@ -1377,16 +1365,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" dependencies = [ "libc", "log", - "miow 0.3.7", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "windows-sys", ] [[package]] @@ -1413,15 +1399,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "multer" version = "2.0.2" @@ -1438,7 +1415,7 @@ dependencies = [ "mime", "spin 0.9.3", "tokio", - "tokio-util 0.6.9", + "tokio-util 0.6.10", "version_check", ] @@ -1508,15 +1485,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "num-bigint" version = "0.3.3" @@ -1547,9 +1515,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -1557,9 +1525,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ "autocfg", "num-integer", @@ -1568,9 +1536,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", "libm", @@ -1588,18 +1556,18 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] [[package]] name = "oauth2" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e47cfc4c0a1a519d9a025ebfbac3a2439d1b5cdf397d72dcb79b11d9920dab" +checksum = "c3bd7d544f02ae0fa9e06137962703d043870d7ad6e6d44786d6a5f20679b2c9" dependencies = [ "base64", "chrono", @@ -1610,7 +1578,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "sha2 0.9.9", + "sha2", "thiserror", "url", ] @@ -1635,18 +1603,30 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.38" +version = "0.10.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" dependencies = [ "bitflags", "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" @@ -1655,9 +1635,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.72" +version = "0.9.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +checksum = "9d5fd19fb3e0a8191c1e34935718976a3e70c112ab9a24af6d7cadccd9d90bc0" dependencies = [ "autocfg", "cc", @@ -1693,7 +1673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ "lock_api", - "parking_lot_core 0.9.2", + "parking_lot_core 0.9.3", ] [[package]] @@ -1712,9 +1692,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1860,9 +1840,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1900,9 +1880,9 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "poise" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2eb79ba8241eb65b549e778e22a242ea30f5829f7487f10d8d95cfff9a4729" +checksum = "046256f9b3bcca8aaed17c412c0e11ccfb8273d2dfea08716e2eb81931465cd4" dependencies = [ "async-trait", "derivative", @@ -1918,9 +1898,9 @@ dependencies = [ [[package]] name = "poise_macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b786b4bdc58345204469420c306d8c638e465b4b1ecad7e27bf9c8a45096cf" +checksum = "94d99712c7e3cef666f344ccf5c5c729939331096d16c35eba3275028191a1af" dependencies = [ "darling", "proc-macro2", @@ -1966,9 +1946,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" dependencies = [ "unicode-xid", ] @@ -2077,18 +2057,18 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +checksum = "685d58625b6c2b83e4cc88a27c4bf65adb7b6b16dbdc413e515c9405b47432ab" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +checksum = "a043824e29c94169374ac5183ac0ed43f5724dc4556b19568007486bd840fa1f" dependencies = [ "proc-macro2", "quote", @@ -2144,7 +2124,6 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "sqlx", "tokio", ] @@ -2203,15 +2182,15 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite", - "rustls 0.20.4", - "rustls-pemfile", + "rustls 0.20.5", + "rustls-pemfile 0.3.0", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls 0.23.3", - "tokio-util 0.6.9", + "tokio-rustls 0.23.4", + "tokio-util 0.6.10", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2259,8 +2238,8 @@ dependencies = [ [[package]] name = "rocket" -version = "0.5.0-rc.1" -source = "git+https://github.com/SergioBenitez/Rocket?branch=master#49d138de14074d40fb9223467434a5626782f51a" +version = "0.5.0-rc.2" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#bf2bd0e9ede12dc227326d069cd84fc98dddf2e4" dependencies = [ "async-stream", "async-trait", @@ -2289,7 +2268,7 @@ dependencies = [ "time 0.3.9", "tokio", "tokio-stream", - "tokio-util 0.7.1", + "tokio-util 0.7.2", "ubyte", "version_check", "yansi", @@ -2297,8 +2276,8 @@ dependencies = [ [[package]] name = "rocket_codegen" -version = "0.5.0-rc.1" -source = "git+https://github.com/SergioBenitez/Rocket?branch=master#49d138de14074d40fb9223467434a5626782f51a" +version = "0.5.0-rc.2" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#bf2bd0e9ede12dc227326d069cd84fc98dddf2e4" dependencies = [ "devise", "glob", @@ -2312,8 +2291,8 @@ dependencies = [ [[package]] name = "rocket_dyn_templates" -version = "0.1.0-rc.1" -source = "git+https://github.com/SergioBenitez/Rocket?branch=master#49d138de14074d40fb9223467434a5626782f51a" +version = "0.1.0-rc.2" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#bf2bd0e9ede12dc227326d069cd84fc98dddf2e4" dependencies = [ "glob", "normpath", @@ -2324,11 +2303,12 @@ dependencies = [ [[package]] name = "rocket_http" -version = "0.5.0-rc.1" -source = "git+https://github.com/SergioBenitez/Rocket?branch=master#49d138de14074d40fb9223467434a5626782f51a" +version = "0.5.0-rc.2" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#bf2bd0e9ede12dc227326d069cd84fc98dddf2e4" dependencies = [ "cookie", "either", + "futures", "http", "hyper", "indexmap", @@ -2338,15 +2318,15 @@ dependencies = [ "percent-encoding", "pin-project-lite", "ref-cast", - "rustls 0.20.4", - "rustls-pemfile", + "rustls 0.20.5", + "rustls-pemfile 1.0.0", "serde", "smallvec", "stable-pattern", "state", "time 0.3.9", "tokio", - "tokio-rustls 0.23.3", + "tokio-rustls 0.23.4", "uncased", ] @@ -2385,9 +2365,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +checksum = "a024a432ae760ab3bff924ad91ce1cfa52cb57ed16e1ef32d0d249cfee1a6c13" dependencies = [ "log", "ring", @@ -2404,6 +2384,15 @@ dependencies = [ "base64", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +dependencies = [ + "base64", +] + [[package]] name = "rustversion" version = "1.0.6" @@ -2492,9 +2481,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" dependencies = [ "serde_derive", ] @@ -2511,9 +2500,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", @@ -2522,9 +2511,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "itoa", "ryu", @@ -2542,9 +2531,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" +checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" dependencies = [ "proc-macro2", "quote", @@ -2617,19 +2606,6 @@ dependencies = [ "digest 0.10.3", ] -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - [[package]] name = "sha2" version = "0.10.2" @@ -2779,7 +2755,7 @@ dependencies = [ "serde", "serde_json", "sha-1 0.10.0", - "sha2 0.10.2", + "sha2", "smallvec", "sqlformat", "sqlx-rt", @@ -2804,7 +2780,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "sha2 0.10.2", + "sha2", "sqlx-core", "sqlx-rt", "syn", @@ -2833,9 +2809,9 @@ dependencies = [ [[package]] name = "state" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf4f5369e6d3044b5e365c9690f451516ac8f0954084622b49ea3fde2f6de5" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" dependencies = [ "loom", ] @@ -2864,9 +2840,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.91" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" +checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a" dependencies = [ "proc-macro2", "quote", @@ -2920,18 +2896,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", @@ -2978,9 +2954,9 @@ checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -2993,14 +2969,14 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.17.0" +version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" dependencies = [ "bytes", "libc", "memchr", - "mio 0.8.2", + "mio 0.8.3", "num_cpus", "once_cell", "parking_lot 0.12.0", @@ -3045,11 +3021,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.3" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.4", + "rustls 0.20.5", "tokio", "webpki 0.22.0", ] @@ -3067,9 +3043,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ "bytes", "futures-core", @@ -3081,9 +3057,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" dependencies = [ "bytes", "futures-core", @@ -3123,9 +3099,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ "proc-macro2", "quote", @@ -3144,9 +3120,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", "log", @@ -3190,7 +3166,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.20.4", + "rustls 0.20.5", "sha-1 0.10.0", "thiserror", "url", @@ -3296,9 +3272,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-normalization" @@ -3317,9 +3293,9 @@ checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "unicode_categories" @@ -3578,9 +3554,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ "windows_aarch64_msvc", "windows_i686_gnu", @@ -3591,33 +3567,33 @@ dependencies = [ [[package]] name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_i686_gnu" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_x86_64_gnu" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "winreg" @@ -3646,6 +3622,6 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zeroize" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb5728b8afd3f280a869ce1d4c554ffaed35f45c231fc41bfbd0381bef50317" +checksum = "94693807d016b2f2d2e14420eb3bfcca689311ff775dcf113d74ea624b7cdf07" diff --git a/Cargo.toml b/Cargo.toml index 44a5026..9cb96c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "reminder_rs" version = "1.6.0" authors = ["jellywx "] edition = "2018" +workspaces = [".", "postman", "web", "entity", "migration"] [dependencies] poise = "0.2" @@ -22,7 +23,6 @@ serde_repr = "0.1" rmp-serde = "0.15" rand = "0.7" levenshtein = "1.0" -sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal", "chrono"]} base64 = "0.13.0" [dependencies.postman] diff --git a/migration/00-initial.sql b/migration/00-initial.sql deleted file mode 100644 index f936746..0000000 --- a/migration/00-initial.sql +++ /dev/null @@ -1,233 +0,0 @@ -CREATE DATABASE IF NOT EXISTS reminders; - -SET FOREIGN_KEY_CHECKS=0; - -USE reminders; - -CREATE TABLE reminders.guilds ( - id INT UNSIGNED UNIQUE NOT NULL AUTO_INCREMENT, - guild BIGINT UNSIGNED UNIQUE NOT NULL, - - name VARCHAR(100), - - prefix VARCHAR(5) DEFAULT '$' NOT NULL, - timezone VARCHAR(32) DEFAULT 'UTC' NOT NULL, - - default_channel_id INT UNSIGNED, - default_username VARCHAR(32) DEFAULT 'Reminder' NOT NULL, - default_avatar VARCHAR(512) DEFAULT 'https://raw.githubusercontent.com/reminder-bot/logos/master/Remind_Me_Bot_Logo_PPic.jpg' NOT NULL, - - PRIMARY KEY (id), - FOREIGN KEY (default_channel_id) REFERENCES reminders.channels(id) ON DELETE SET NULL -); - -CREATE TABLE reminders.channels ( - id INT UNSIGNED UNIQUE NOT NULL AUTO_INCREMENT, - channel BIGINT UNSIGNED UNIQUE NOT NULL, - - name VARCHAR(100), - - nudge SMALLINT NOT NULL DEFAULT 0, - blacklisted BOOL NOT NULL DEFAULT FALSE, - - webhook_id BIGINT UNSIGNED UNIQUE, - webhook_token TEXT, - - paused BOOL NOT NULL DEFAULT 0, - paused_until TIMESTAMP, - - guild_id INT UNSIGNED, - - PRIMARY KEY (id), - FOREIGN KEY (guild_id) REFERENCES reminders.guilds(id) ON DELETE CASCADE -); - -CREATE TABLE reminders.users ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - user BIGINT UNSIGNED UNIQUE NOT NULL, - - name VARCHAR(37) NOT NULL, - - dm_channel INT UNSIGNED UNIQUE NOT NULL, - - language VARCHAR(2) DEFAULT 'EN' NOT NULL, - timezone VARCHAR(32) DEFAULT 'UTC' NOT NULL, - meridian_time BOOLEAN DEFAULT 0 NOT NULL, - - allowed_dm BOOLEAN DEFAULT 1 NOT NULL, - - patreon BOOLEAN NOT NULL DEFAULT 0, - - PRIMARY KEY (id), - FOREIGN KEY (dm_channel) REFERENCES reminders.channels(id) ON DELETE RESTRICT -); - -CREATE TABLE reminders.roles ( - id INT UNSIGNED UNIQUE NOT NULL AUTO_INCREMENT, - role BIGINT UNSIGNED UNIQUE NOT NULL, - - name VARCHAR(100), - - guild_id INT UNSIGNED NOT NULL, - - PRIMARY KEY (id), - FOREIGN KEY (guild_id) REFERENCES reminders.guilds(id) ON DELETE CASCADE -); - -CREATE TABLE reminders.embeds ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - - title VARCHAR(256) NOT NULL DEFAULT '', - description VARCHAR(2048) NOT NULL DEFAULT '', - - image_url VARCHAR(512), - thumbnail_url VARCHAR(512), - - footer VARCHAR(2048) NOT NULL DEFAULT '', - footer_icon VARCHAR(512), - - color MEDIUMINT UNSIGNED NOT NULL DEFAULT 0x0, - - PRIMARY KEY (id) -); - -CREATE TABLE reminders.embed_fields ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - - title VARCHAR(256) NOT NULL DEFAULT '', - value VARCHAR(1024) NOT NULL DEFAULT '', - inline BOOL NOT NULL DEFAULT 0, - embed_id INT UNSIGNED NOT NULL, - - PRIMARY KEY (id), - FOREIGN KEY (embed_id) REFERENCES reminders.embeds(id) ON DELETE CASCADE -); - -CREATE TABLE reminders.messages ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - - content VARCHAR(2048) NOT NULL DEFAULT '', - tts BOOL NOT NULL DEFAULT 0, - embed_id INT UNSIGNED, - - attachment MEDIUMBLOB, - attachment_name VARCHAR(260), - - PRIMARY KEY (id), - FOREIGN KEY (embed_id) REFERENCES reminders.embeds(id) ON DELETE SET NULL -); - -CREATE TABLE reminders.reminders ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - uid VARCHAR(64) UNIQUE NOT NULL, - - name VARCHAR(24) NOT NULL DEFAULT 'Reminder', - - message_id INT UNSIGNED NOT NULL, - channel_id INT UNSIGNED NOT NULL, - - `time` INT UNSIGNED DEFAULT 0 NOT NULL, - `interval` INT UNSIGNED DEFAULT NULL, - expires TIMESTAMP DEFAULT NULL, - - enabled BOOLEAN DEFAULT 1 NOT NULL, - - avatar VARCHAR(512), - username VARCHAR(32), - - method ENUM('remind', 'natural', 'dashboard', 'todo', 'countdown'), - set_at TIMESTAMP DEFAULT NOW(), - set_by INT UNSIGNED, - - PRIMARY KEY (id), - FOREIGN KEY (message_id) REFERENCES reminders.messages(id) ON DELETE RESTRICT, - FOREIGN KEY (channel_id) REFERENCES reminders.channels(id) ON DELETE CASCADE, - FOREIGN KEY (set_by) REFERENCES reminders.users(id) ON DELETE SET NULL -); - -CREATE TRIGGER message_cleanup AFTER DELETE ON reminders.reminders -FOR EACH ROW - DELETE FROM reminders.messages WHERE id = OLD.message_id; - -CREATE TRIGGER embed_cleanup AFTER DELETE ON reminders.messages -FOR EACH ROW - DELETE FROM reminders.embeds WHERE id = OLD.embed_id; - -CREATE TABLE reminders.todos ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - user_id INT UNSIGNED, - guild_id INT UNSIGNED, - channel_id INT UNSIGNED, - value VARCHAR(2000) NOT NULL, - - PRIMARY KEY (id), - FOREIGN KEY (user_id) REFERENCES reminders.users(id) ON DELETE SET NULL, - FOREIGN KEY (guild_id) REFERENCES reminders.guilds(id) ON DELETE CASCADE, - FOREIGN KEY (channel_id) REFERENCES reminders.channels(id) ON DELETE SET NULL -); - -CREATE TABLE reminders.command_restrictions ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - - role_id INT UNSIGNED NOT NULL, - command ENUM('todos', 'natural', 'remind', 'interval', 'timer', 'del', 'look', 'alias', 'countdown') NOT NULL, - - PRIMARY KEY (id), - FOREIGN KEY (role_id) REFERENCES reminders.roles(id) ON DELETE CASCADE, - UNIQUE KEY (`role_id`, `command`) -); - -CREATE TABLE reminders.timers ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - start_time TIMESTAMP NOT NULL DEFAULT NOW(), - name VARCHAR(32) NOT NULL, - owner BIGINT UNSIGNED NOT NULL, - - PRIMARY KEY (id) -); - -CREATE TABLE reminders.events ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - `time` TIMESTAMP NOT NULL DEFAULT NOW(), - - event_name ENUM('edit', 'enable', 'disable', 'delete') NOT NULL, - bulk_count INT UNSIGNED, - - guild_id INT UNSIGNED NOT NULL, - user_id INT UNSIGNED, - reminder_id INT UNSIGNED, - - PRIMARY KEY (id), - FOREIGN KEY (guild_id) REFERENCES reminders.guilds(id) ON DELETE CASCADE, - FOREIGN KEY (user_id) REFERENCES reminders.users(id) ON DELETE SET NULL, - FOREIGN KEY (reminder_id) REFERENCES reminders.reminders(id) ON DELETE SET NULL -); - -CREATE TABLE reminders.command_aliases ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - - guild_id INT UNSIGNED NOT NULL, - name VARCHAR(12) NOT NULL, - - command VARCHAR(2048) NOT NULL, - - PRIMARY KEY (id), - FOREIGN KEY (guild_id) REFERENCES reminders.guilds(id) ON DELETE CASCADE, - UNIQUE KEY (`guild_id`, `name`) -); - -CREATE TABLE reminders.guild_users ( - guild INT UNSIGNED NOT NULL, - user INT UNSIGNED NOT NULL, - - can_access BOOL NOT NULL DEFAULT 0, - - FOREIGN KEY (guild) REFERENCES reminders.guilds(id) ON DELETE CASCADE, - FOREIGN KEY (user) REFERENCES reminders.users(id) ON DELETE CASCADE, - UNIQUE KEY (guild, user) -); - -CREATE EVENT reminders.event_cleanup -ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY -ON COMPLETION PRESERVE -DO DELETE FROM reminders.events WHERE `time` < DATE_SUB(NOW(), INTERVAL 5 DAY); diff --git a/migration/01-reminder_message_embed.sql b/migration/01-reminder_message_embed.sql deleted file mode 100644 index 2bab286..0000000 --- a/migration/01-reminder_message_embed.sql +++ /dev/null @@ -1,160 +0,0 @@ -USE reminders; - -SET FOREIGN_KEY_CHECKS = 0; - -DROP TABLE IF EXISTS reminders_new; -DROP TABLE IF EXISTS embed_fields_new; - -# create new reminders table structure -CREATE TABLE reminders_new ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `uid` VARCHAR(64) NOT NULL UNIQUE, - - `name` VARCHAR(24) NOT NULL DEFAULT 'Reminder', - - `channel_id` INT UNSIGNED NOT NULL, - - `utc_time` DATETIME NOT NULL, - `timezone` ENUM('Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu') NOT NULL DEFAULT 'UTC', - - `interval` INT UNSIGNED, - `restartable` BOOL NOT NULL DEFAULT 0, - `enabled` BOOL NOT NULL DEFAULT 1, - `expires` DATETIME, - - `username` VARCHAR(32) DEFAULT NULL, - `avatar` VARCHAR(512) DEFAULT NULL, - - `content` VARCHAR(2048) NOT NULL DEFAULT '', - `tts` BOOL NOT NULL DEFAULT 0, - `attachment` MEDIUMBLOB, - `attachment_name` VARCHAR(260), - - `embed_title` VARCHAR(256) NOT NULL DEFAULT '', - `embed_description` VARCHAR(2048) NOT NULL DEFAULT '', - `embed_image_url` VARCHAR(512), - `embed_thumbnail_url` VARCHAR(512), - `embed_footer` VARCHAR(2048) NOT NULL DEFAULT '', - `embed_footer_url` VARCHAR(512), - `embed_author` VARCHAR(256) NOT NULL DEFAULT '', - `embed_author_url` VARCHAR(512), - `embed_color` INT UNSIGNED NOT NULL DEFAULT 0x0, - - `pin` BOOL NOT NULL DEFAULT 0, - - `set_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - `set_by` INT UNSIGNED DEFAULT NULL, - - PRIMARY KEY (id), - - FOREIGN KEY (`channel_id`) REFERENCES channels (`id`) ON DELETE CASCADE, - FOREIGN KEY (`set_by`) REFERENCES users (`id`) ON DELETE SET NULL - - # disallow having a reminder as restartable if it has no interval - -- , CONSTRAINT restartable_interval_mutex CHECK (`restartable` = 0 OR `interval` IS NULL) - # disallow disabling if interval is unspecified - -- , CONSTRAINT interval_enabled_mutin CHECK (`enabled` = 1 OR `interval` IS NULL) - # disallow an expiry time if interval is unspecified - -- , CONSTRAINT interval_expires_mutin CHECK (`expires` IS NULL OR `interval` IS NOT NULL) -); - -# import data from other tables -INSERT INTO reminders_new ( - uid, - name, - channel_id, - `utc_time`, - `interval`, - enabled, - expires, - username, - avatar, - content, - tts, - attachment, - attachment_name, - embed_title, - embed_description, - embed_image_url, - embed_thumbnail_url, - embed_footer, - embed_footer_url, - embed_color, - set_at, - set_by - ) SELECT - reminders.uid, - reminders.name, - reminders.channel_id, - DATE_ADD(FROM_UNIXTIME(0), INTERVAL reminders.`time` SECOND), - reminders.`interval`, - reminders.enabled, - reminders.expires, - reminders.username, - reminders.avatar, - messages.content, - messages.tts, - messages.attachment, - messages.attachment_name, - IFNULL(embeds.title, ''), - IFNULL(embeds.description, ''), - embeds.image_url, - embeds.thumbnail_url, - IFNULL(embeds.footer, ''), - embeds.footer_icon, - IFNULL(embeds.color, 0), - reminders.set_at, - reminders.set_by - FROM reminders - INNER JOIN messages ON reminders.message_id = messages.id - LEFT JOIN embeds ON messages.embed_id = embeds.id; - -CREATE TABLE embed_fields_new ( - id INT UNSIGNED NOT NULL AUTO_INCREMENT, - - title VARCHAR(256) NOT NULL, - value VARCHAR(1024) NOT NULL, - inline BOOL NOT NULL DEFAULT 0, - - reminder_id INT UNSIGNED, - - PRIMARY KEY (id), - - FOREIGN KEY (reminder_id) REFERENCES reminders_new (id) ON DELETE CASCADE -); - -INSERT INTO embed_fields_new ( - title, - value, - inline, - reminder_id - ) SELECT - embed_fields.title, - embed_fields.value, - embed_fields.inline, - (SELECT id FROM reminders_new WHERE reminders_new.uid = reminders.uid) - FROM embed_fields - INNER JOIN embeds e on e.id = embed_fields.embed_id - INNER JOIN messages m on e.id = m.embed_id - INNER JOIN reminders on m.id = reminders.message_id; - -DROP TABLE IF EXISTS events; - -CREATE TABLE events ( - id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL, - `time` TIMESTAMP NOT NULL DEFAULT NOW(), - - event_name ENUM('edit', 'enable', 'disable', 'delete') NOT NULL, - bulk_count INT UNSIGNED, - - guild_id INT UNSIGNED NOT NULL, - user_id INT UNSIGNED, - reminder_id INT UNSIGNED, - - PRIMARY KEY (id), - FOREIGN KEY (guild_id) REFERENCES guilds(id) ON DELETE CASCADE, - FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL, - FOREIGN KEY (reminder_id) REFERENCES reminders_new(id) ON DELETE SET NULL -); - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/migration/02-macro.sql b/migration/02-macro.sql deleted file mode 100644 index a9284e9..0000000 --- a/migration/02-macro.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE reminders; - -CREATE TABLE macro ( - id INT UNSIGNED AUTO_INCREMENT, - guild_id INT UNSIGNED NOT NULL, - - name VARCHAR(100) NOT NULL, - description VARCHAR(100), - commands TEXT NOT NULL, - - FOREIGN KEY (guild_id) REFERENCES guilds(id) ON DELETE CASCADE, - PRIMARY KEY (id) -); diff --git a/migration/03-reminder_variable_intervals.sql b/migration/03-reminder_variable_intervals.sql deleted file mode 100644 index d539db4..0000000 --- a/migration/03-reminder_variable_intervals.sql +++ /dev/null @@ -1,4 +0,0 @@ -USE reminders; - -ALTER TABLE reminders.reminders RENAME COLUMN `interval` TO `interval_seconds`; -ALTER TABLE reminders.reminders ADD COLUMN `interval_months` INT UNSIGNED DEFAULT NULL; diff --git a/migration/04-reminder_templates.sql b/migration/04-reminder_templates.sql deleted file mode 100644 index 28afe79..0000000 --- a/migration/04-reminder_templates.sql +++ /dev/null @@ -1,51 +0,0 @@ -USE reminders; - -CREATE TABLE reminder_template ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - - `name` VARCHAR(24) NOT NULL DEFAULT 'Reminder', - - `guild_id` INT UNSIGNED NOT NULL, - - `username` VARCHAR(32) DEFAULT NULL, - `avatar` VARCHAR(512) DEFAULT NULL, - - `content` VARCHAR(2048) NOT NULL DEFAULT '', - `tts` BOOL NOT NULL DEFAULT 0, - `attachment` MEDIUMBLOB, - `attachment_name` VARCHAR(260), - - `embed_title` VARCHAR(256) NOT NULL DEFAULT '', - `embed_description` VARCHAR(2048) NOT NULL DEFAULT '', - `embed_image_url` VARCHAR(512), - `embed_thumbnail_url` VARCHAR(512), - `embed_footer` VARCHAR(2048) NOT NULL DEFAULT '', - `embed_footer_url` VARCHAR(512), - `embed_author` VARCHAR(256) NOT NULL DEFAULT '', - `embed_author_url` VARCHAR(512), - `embed_color` INT UNSIGNED NOT NULL DEFAULT 0x0, - `embed_fields` JSON, - - PRIMARY KEY (id), - - FOREIGN KEY (`guild_id`) REFERENCES guilds (`id`) ON DELETE CASCADE -); - -ALTER TABLE reminders ADD COLUMN embed_fields JSON; - -update reminders - inner join embed_fields as E - on E.reminder_id = reminders.id -set embed_fields = ( - select JSON_ARRAYAGG( - JSON_OBJECT( - 'title', E.title, - 'value', E.value, - 'inline', - if(inline = 1, cast(TRUE as json), cast(FALSE as json)) - ) - ) - from embed_fields - group by reminder_id - having reminder_id = reminders.id - ); diff --git a/models/Cargo.lock b/models/Cargo.lock new file mode 100644 index 0000000..4392f37 --- /dev/null +++ b/models/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "models" +version = "0.1.0" diff --git a/models/Cargo.toml b/models/Cargo.toml new file mode 100644 index 0000000..2c2e890 --- /dev/null +++ b/models/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "models" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/models/entity/Cargo.toml b/models/entity/Cargo.toml new file mode 100644 index 0000000..bc053f5 --- /dev/null +++ b/models/entity/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "entity" +version = "0.1.0" +edition = "2021" + +[dependencies] +chrono-tz = "^0.6" +sea-orm = { version = "^0.8", features = ["sqlx-postgres", "runtime-tokio-native-tls", "macros"] } diff --git a/models/entity/src/channel.rs b/models/entity/src/channel.rs new file mode 100644 index 0000000..34167b4 --- /dev/null +++ b/models/entity/src/channel.rs @@ -0,0 +1,60 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "channel")] +pub struct Model { + #[sea_orm(primary_key, auto_increment = false)] + pub id: i64, + pub guild_id: Option, + pub nudge: i32, + pub webhook_id: Option, + pub webhook_token: Option, + pub paused: bool, + pub paused_until: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::guild::Entity", + from = "Column::GuildId", + to = "super::guild::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Guild, + #[sea_orm(has_many = "super::user::Entity")] + User, + #[sea_orm(has_many = "super::reminder::Entity")] + Reminder, + #[sea_orm(has_many = "super::todo::Entity")] + Todo, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Guild.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::User.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Reminder.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Todo.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/command_macro.rs b/models/entity/src/command_macro.rs new file mode 100644 index 0000000..9fb5bd9 --- /dev/null +++ b/models/entity/src/command_macro.rs @@ -0,0 +1,34 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "command_macro")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub guild_id: i64, + pub name: String, + pub description: Option, + pub commands: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::guild::Entity", + from = "Column::GuildId", + to = "super::guild::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Guild, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Guild.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/guild.rs b/models/entity/src/guild.rs new file mode 100644 index 0000000..8eac4c1 --- /dev/null +++ b/models/entity/src/guild.rs @@ -0,0 +1,48 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "guild")] +pub struct Model { + #[sea_orm(primary_key, auto_increment = false)] + pub id: i64, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm(has_many = "super::reminder_template::Entity")] + ReminderTemplate, + #[sea_orm(has_many = "super::channel::Entity")] + Channel, + #[sea_orm(has_many = "super::todo::Entity")] + Todo, + #[sea_orm(has_many = "super::command_macro::Entity")] + CommandMacro, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::ReminderTemplate.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Channel.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Todo.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::CommandMacro.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/lib.rs b/models/entity/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/models/entity/src/lib.rs @@ -0,0 +1 @@ + diff --git a/models/entity/src/mod.rs b/models/entity/src/mod.rs new file mode 100644 index 0000000..0e25d5f --- /dev/null +++ b/models/entity/src/mod.rs @@ -0,0 +1,14 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +pub mod prelude; + +pub mod channel; +pub mod command_macro; +pub mod guild; +pub mod reminder; +pub mod reminder_template; +pub mod sea_orm_active_enums; +pub mod seaql_migrations; +pub mod timer; +pub mod todo; +pub mod user; diff --git a/models/entity/src/prelude.rs b/models/entity/src/prelude.rs new file mode 100644 index 0000000..fbef7c8 --- /dev/null +++ b/models/entity/src/prelude.rs @@ -0,0 +1,8 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +pub use super::{ + channel::Entity as Channel, command_macro::Entity as CommandMacro, guild::Entity as Guild, + reminder::Entity as Reminder, reminder_template::Entity as ReminderTemplate, + seaql_migrations::Entity as SeaqlMigrations, timer::Entity as Timer, todo::Entity as Todo, + user::Entity as User, +}; diff --git a/models/entity/src/reminder.rs b/models/entity/src/reminder.rs new file mode 100644 index 0000000..1733440 --- /dev/null +++ b/models/entity/src/reminder.rs @@ -0,0 +1,73 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +use super::sea_orm_active_enums::Timezone; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "reminder")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub uid: String, + pub name: String, + pub channel_id: i64, + pub utc_time: DateTimeUtc, + pub timezone: Timezone, + pub interval_seconds: Option, + pub interval_months: Option, + pub enabled: bool, + pub expires: Option, + pub username: Option, + pub avatar: Option, + pub content: Option, + pub tts: bool, + pub attachment: Option>, + pub attachment_name: Option, + pub embed_title: Option, + pub embed_description: Option, + pub embed_image_url: Option, + pub embed_thumbnail_url: Option, + pub embed_footer: Option, + pub embed_footer_url: Option, + pub embed_author: Option, + pub embed_author_url: Option, + pub embed_color: Option, + pub embed_fields: Option, + pub set_at: DateTimeUtc, + pub set_by: i64, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::channel::Entity", + from = "Column::ChannelId", + to = "super::channel::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Channel, + #[sea_orm( + belongs_to = "super::user::Entity", + from = "Column::SetBy", + to = "super::user::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + User, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Channel.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::User.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/reminder_template.rs b/models/entity/src/reminder_template.rs new file mode 100644 index 0000000..1713758 --- /dev/null +++ b/models/entity/src/reminder_template.rs @@ -0,0 +1,48 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "reminder_template")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub guild_id: i64, + pub name: String, + pub username: Option, + pub avatar: Option, + pub content: Option, + pub tts: bool, + pub attachment: Option>, + pub attachment_name: Option, + pub embed_title: Option, + pub embed_description: Option, + pub embed_image_url: Option, + pub embed_thumbnail_url: Option, + pub embed_footer: Option, + pub embed_footer_url: Option, + pub embed_author: Option, + pub embed_author_url: Option, + pub embed_color: Option, + pub embed_fields: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::guild::Entity", + from = "Column::GuildId", + to = "super::guild::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Guild, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Guild.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/sea_orm_active_enums.rs b/models/entity/src/sea_orm_active_enums.rs new file mode 100644 index 0000000..a16826f --- /dev/null +++ b/models/entity/src/sea_orm_active_enums.rs @@ -0,0 +1,1196 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "timezone")] +pub enum Timezone { + #[sea_orm(string_value = "Africa/Abidjan")] + AfricaAbidjan, + #[sea_orm(string_value = "Africa/Accra")] + AfricaAccra, + #[sea_orm(string_value = "Africa/Addis_Ababa")] + AfricaAddisAbaba, + #[sea_orm(string_value = "Africa/Algiers")] + AfricaAlgiers, + #[sea_orm(string_value = "Africa/Asmara")] + AfricaAsmara, + #[sea_orm(string_value = "Africa/Asmera")] + AfricaAsmera, + #[sea_orm(string_value = "Africa/Bamako")] + AfricaBamako, + #[sea_orm(string_value = "Africa/Bangui")] + AfricaBangui, + #[sea_orm(string_value = "Africa/Banjul")] + AfricaBanjul, + #[sea_orm(string_value = "Africa/Bissau")] + AfricaBissau, + #[sea_orm(string_value = "Africa/Blantyre")] + AfricaBlantyre, + #[sea_orm(string_value = "Africa/Brazzaville")] + AfricaBrazzaville, + #[sea_orm(string_value = "Africa/Bujumbura")] + AfricaBujumbura, + #[sea_orm(string_value = "Africa/Cairo")] + AfricaCairo, + #[sea_orm(string_value = "Africa/Casablanca")] + AfricaCasablanca, + #[sea_orm(string_value = "Africa/Ceuta")] + AfricaCeuta, + #[sea_orm(string_value = "Africa/Conakry")] + AfricaConakry, + #[sea_orm(string_value = "Africa/Dakar")] + AfricaDakar, + #[sea_orm(string_value = "Africa/Dar_es_Salaam")] + AfricaDarEsSalaam, + #[sea_orm(string_value = "Africa/Djibouti")] + AfricaDjibouti, + #[sea_orm(string_value = "Africa/Douala")] + AfricaDouala, + #[sea_orm(string_value = "Africa/El_Aaiun")] + AfricaElAaiun, + #[sea_orm(string_value = "Africa/Freetown")] + AfricaFreetown, + #[sea_orm(string_value = "Africa/Gaborone")] + AfricaGaborone, + #[sea_orm(string_value = "Africa/Harare")] + AfricaHarare, + #[sea_orm(string_value = "Africa/Johannesburg")] + AfricaJohannesburg, + #[sea_orm(string_value = "Africa/Juba")] + AfricaJuba, + #[sea_orm(string_value = "Africa/Kampala")] + AfricaKampala, + #[sea_orm(string_value = "Africa/Khartoum")] + AfricaKhartoum, + #[sea_orm(string_value = "Africa/Kigali")] + AfricaKigali, + #[sea_orm(string_value = "Africa/Kinshasa")] + AfricaKinshasa, + #[sea_orm(string_value = "Africa/Lagos")] + AfricaLagos, + #[sea_orm(string_value = "Africa/Libreville")] + AfricaLibreville, + #[sea_orm(string_value = "Africa/Lome")] + AfricaLome, + #[sea_orm(string_value = "Africa/Luanda")] + AfricaLuanda, + #[sea_orm(string_value = "Africa/Lubumbashi")] + AfricaLubumbashi, + #[sea_orm(string_value = "Africa/Lusaka")] + AfricaLusaka, + #[sea_orm(string_value = "Africa/Malabo")] + AfricaMalabo, + #[sea_orm(string_value = "Africa/Maputo")] + AfricaMaputo, + #[sea_orm(string_value = "Africa/Maseru")] + AfricaMaseru, + #[sea_orm(string_value = "Africa/Mbabane")] + AfricaMbabane, + #[sea_orm(string_value = "Africa/Mogadishu")] + AfricaMogadishu, + #[sea_orm(string_value = "Africa/Monrovia")] + AfricaMonrovia, + #[sea_orm(string_value = "Africa/Nairobi")] + AfricaNairobi, + #[sea_orm(string_value = "Africa/Ndjamena")] + AfricaNdjamena, + #[sea_orm(string_value = "Africa/Niamey")] + AfricaNiamey, + #[sea_orm(string_value = "Africa/Nouakchott")] + AfricaNouakchott, + #[sea_orm(string_value = "Africa/Ouagadougou")] + AfricaOuagadougou, + #[sea_orm(string_value = "Africa/Porto-Novo")] + AfricaPortoNovo, + #[sea_orm(string_value = "Africa/Sao_Tome")] + AfricaSaoTome, + #[sea_orm(string_value = "Africa/Timbuktu")] + AfricaTimbuktu, + #[sea_orm(string_value = "Africa/Tripoli")] + AfricaTripoli, + #[sea_orm(string_value = "Africa/Tunis")] + AfricaTunis, + #[sea_orm(string_value = "Africa/Windhoek")] + AfricaWindhoek, + #[sea_orm(string_value = "America/Adak")] + AmericaAdak, + #[sea_orm(string_value = "America/Anchorage")] + AmericaAnchorage, + #[sea_orm(string_value = "America/Anguilla")] + AmericaAnguilla, + #[sea_orm(string_value = "America/Antigua")] + AmericaAntigua, + #[sea_orm(string_value = "America/Araguaina")] + AmericaAraguaina, + #[sea_orm(string_value = "America/Argentina/Buenos_Aires")] + AmericaArgentinaBuenosAires, + #[sea_orm(string_value = "America/Argentina/Catamarca")] + AmericaArgentinaCatamarca, + #[sea_orm(string_value = "America/Argentina/ComodRivadavia")] + AmericaArgentinaComodRivadavia, + #[sea_orm(string_value = "America/Argentina/Cordoba")] + AmericaArgentinaCordoba, + #[sea_orm(string_value = "America/Argentina/Jujuy")] + AmericaArgentinaJujuy, + #[sea_orm(string_value = "America/Argentina/La_Rioja")] + AmericaArgentinaLaRioja, + #[sea_orm(string_value = "America/Argentina/Mendoza")] + AmericaArgentinaMendoza, + #[sea_orm(string_value = "America/Argentina/Rio_Gallegos")] + AmericaArgentinaRioGallegos, + #[sea_orm(string_value = "America/Argentina/Salta")] + AmericaArgentinaSalta, + #[sea_orm(string_value = "America/Argentina/San_Juan")] + AmericaArgentinaSanJuan, + #[sea_orm(string_value = "America/Argentina/San_Luis")] + AmericaArgentinaSanLuis, + #[sea_orm(string_value = "America/Argentina/Tucuman")] + AmericaArgentinaTucuman, + #[sea_orm(string_value = "America/Argentina/Ushuaia")] + AmericaArgentinaUshuaia, + #[sea_orm(string_value = "America/Aruba")] + AmericaAruba, + #[sea_orm(string_value = "America/Asuncion")] + AmericaAsuncion, + #[sea_orm(string_value = "America/Atikokan")] + AmericaAtikokan, + #[sea_orm(string_value = "America/Atka")] + AmericaAtka, + #[sea_orm(string_value = "America/Bahia")] + AmericaBahia, + #[sea_orm(string_value = "America/Bahia_Banderas")] + AmericaBahiaBanderas, + #[sea_orm(string_value = "America/Barbados")] + AmericaBarbados, + #[sea_orm(string_value = "America/Belem")] + AmericaBelem, + #[sea_orm(string_value = "America/Belize")] + AmericaBelize, + #[sea_orm(string_value = "America/Blanc-Sablon")] + AmericaBlancSablon, + #[sea_orm(string_value = "America/Boa_Vista")] + AmericaBoaVista, + #[sea_orm(string_value = "America/Bogota")] + AmericaBogota, + #[sea_orm(string_value = "America/Boise")] + AmericaBoise, + #[sea_orm(string_value = "America/Buenos_Aires")] + AmericaBuenosAires, + #[sea_orm(string_value = "America/Cambridge_Bay")] + AmericaCambridgeBay, + #[sea_orm(string_value = "America/Campo_Grande")] + AmericaCampoGrande, + #[sea_orm(string_value = "America/Cancun")] + AmericaCancun, + #[sea_orm(string_value = "America/Caracas")] + AmericaCaracas, + #[sea_orm(string_value = "America/Catamarca")] + AmericaCatamarca, + #[sea_orm(string_value = "America/Cayenne")] + AmericaCayenne, + #[sea_orm(string_value = "America/Cayman")] + AmericaCayman, + #[sea_orm(string_value = "America/Chicago")] + AmericaChicago, + #[sea_orm(string_value = "America/Chihuahua")] + AmericaChihuahua, + #[sea_orm(string_value = "America/Coral_Harbour")] + AmericaCoralHarbour, + #[sea_orm(string_value = "America/Cordoba")] + AmericaCordoba, + #[sea_orm(string_value = "America/Costa_Rica")] + AmericaCostaRica, + #[sea_orm(string_value = "America/Creston")] + AmericaCreston, + #[sea_orm(string_value = "America/Cuiaba")] + AmericaCuiaba, + #[sea_orm(string_value = "America/Curacao")] + AmericaCuracao, + #[sea_orm(string_value = "America/Danmarkshavn")] + AmericaDanmarkshavn, + #[sea_orm(string_value = "America/Dawson")] + AmericaDawson, + #[sea_orm(string_value = "America/Dawson_Creek")] + AmericaDawsonCreek, + #[sea_orm(string_value = "America/Denver")] + AmericaDenver, + #[sea_orm(string_value = "America/Detroit")] + AmericaDetroit, + #[sea_orm(string_value = "America/Dominica")] + AmericaDominica, + #[sea_orm(string_value = "America/Edmonton")] + AmericaEdmonton, + #[sea_orm(string_value = "America/Eirunepe")] + AmericaEirunepe, + #[sea_orm(string_value = "America/El_Salvador")] + AmericaElSalvador, + #[sea_orm(string_value = "America/Ensenada")] + AmericaEnsenada, + #[sea_orm(string_value = "America/Fort_Nelson")] + AmericaFortNelson, + #[sea_orm(string_value = "America/Fort_Wayne")] + AmericaFortWayne, + #[sea_orm(string_value = "America/Fortaleza")] + AmericaFortaleza, + #[sea_orm(string_value = "America/Glace_Bay")] + AmericaGlaceBay, + #[sea_orm(string_value = "America/Godthab")] + AmericaGodthab, + #[sea_orm(string_value = "America/Goose_Bay")] + AmericaGooseBay, + #[sea_orm(string_value = "America/Grand_Turk")] + AmericaGrandTurk, + #[sea_orm(string_value = "America/Grenada")] + AmericaGrenada, + #[sea_orm(string_value = "America/Guadeloupe")] + AmericaGuadeloupe, + #[sea_orm(string_value = "America/Guatemala")] + AmericaGuatemala, + #[sea_orm(string_value = "America/Guayaquil")] + AmericaGuayaquil, + #[sea_orm(string_value = "America/Guyana")] + AmericaGuyana, + #[sea_orm(string_value = "America/Halifax")] + AmericaHalifax, + #[sea_orm(string_value = "America/Havana")] + AmericaHavana, + #[sea_orm(string_value = "America/Hermosillo")] + AmericaHermosillo, + #[sea_orm(string_value = "America/Indiana/Indianapolis")] + AmericaIndianaIndianapolis, + #[sea_orm(string_value = "America/Indiana/Knox")] + AmericaIndianaKnox, + #[sea_orm(string_value = "America/Indiana/Marengo")] + AmericaIndianaMarengo, + #[sea_orm(string_value = "America/Indiana/Petersburg")] + AmericaIndianaPetersburg, + #[sea_orm(string_value = "America/Indiana/Tell_City")] + AmericaIndianaTellCity, + #[sea_orm(string_value = "America/Indiana/Vevay")] + AmericaIndianaVevay, + #[sea_orm(string_value = "America/Indiana/Vincennes")] + AmericaIndianaVincennes, + #[sea_orm(string_value = "America/Indiana/Winamac")] + AmericaIndianaWinamac, + #[sea_orm(string_value = "America/Indianapolis")] + AmericaIndianapolis, + #[sea_orm(string_value = "America/Inuvik")] + AmericaInuvik, + #[sea_orm(string_value = "America/Iqaluit")] + AmericaIqaluit, + #[sea_orm(string_value = "America/Jamaica")] + AmericaJamaica, + #[sea_orm(string_value = "America/Jujuy")] + AmericaJujuy, + #[sea_orm(string_value = "America/Juneau")] + AmericaJuneau, + #[sea_orm(string_value = "America/Kentucky/Louisville")] + AmericaKentuckyLouisville, + #[sea_orm(string_value = "America/Kentucky/Monticello")] + AmericaKentuckyMonticello, + #[sea_orm(string_value = "America/Knox_IN")] + AmericaKnoxIn, + #[sea_orm(string_value = "America/Kralendijk")] + AmericaKralendijk, + #[sea_orm(string_value = "America/La_Paz")] + AmericaLaPaz, + #[sea_orm(string_value = "America/Lima")] + AmericaLima, + #[sea_orm(string_value = "America/Los_Angeles")] + AmericaLosAngeles, + #[sea_orm(string_value = "America/Louisville")] + AmericaLouisville, + #[sea_orm(string_value = "America/Lower_Princes")] + AmericaLowerPrinces, + #[sea_orm(string_value = "America/Maceio")] + AmericaMaceio, + #[sea_orm(string_value = "America/Managua")] + AmericaManagua, + #[sea_orm(string_value = "America/Manaus")] + AmericaManaus, + #[sea_orm(string_value = "America/Marigot")] + AmericaMarigot, + #[sea_orm(string_value = "America/Martinique")] + AmericaMartinique, + #[sea_orm(string_value = "America/Matamoros")] + AmericaMatamoros, + #[sea_orm(string_value = "America/Mazatlan")] + AmericaMazatlan, + #[sea_orm(string_value = "America/Mendoza")] + AmericaMendoza, + #[sea_orm(string_value = "America/Menominee")] + AmericaMenominee, + #[sea_orm(string_value = "America/Merida")] + AmericaMerida, + #[sea_orm(string_value = "America/Metlakatla")] + AmericaMetlakatla, + #[sea_orm(string_value = "America/Mexico_City")] + AmericaMexicoCity, + #[sea_orm(string_value = "America/Miquelon")] + AmericaMiquelon, + #[sea_orm(string_value = "America/Moncton")] + AmericaMoncton, + #[sea_orm(string_value = "America/Monterrey")] + AmericaMonterrey, + #[sea_orm(string_value = "America/Montevideo")] + AmericaMontevideo, + #[sea_orm(string_value = "America/Montreal")] + AmericaMontreal, + #[sea_orm(string_value = "America/Montserrat")] + AmericaMontserrat, + #[sea_orm(string_value = "America/Nassau")] + AmericaNassau, + #[sea_orm(string_value = "America/New_York")] + AmericaNewYork, + #[sea_orm(string_value = "America/Nipigon")] + AmericaNipigon, + #[sea_orm(string_value = "America/Nome")] + AmericaNome, + #[sea_orm(string_value = "America/Noronha")] + AmericaNoronha, + #[sea_orm(string_value = "America/North_Dakota/Beulah")] + AmericaNorthDakotaBeulah, + #[sea_orm(string_value = "America/North_Dakota/Center")] + AmericaNorthDakotaCenter, + #[sea_orm(string_value = "America/North_Dakota/New_Salem")] + AmericaNorthDakotaNewSalem, + #[sea_orm(string_value = "America/Nuuk")] + AmericaNuuk, + #[sea_orm(string_value = "America/Ojinaga")] + AmericaOjinaga, + #[sea_orm(string_value = "America/Panama")] + AmericaPanama, + #[sea_orm(string_value = "America/Pangnirtung")] + AmericaPangnirtung, + #[sea_orm(string_value = "America/Paramaribo")] + AmericaParamaribo, + #[sea_orm(string_value = "America/Phoenix")] + AmericaPhoenix, + #[sea_orm(string_value = "America/Port-au-Prince")] + AmericaPortAuPrince, + #[sea_orm(string_value = "America/Port_of_Spain")] + AmericaPortOfSpain, + #[sea_orm(string_value = "America/Porto_Acre")] + AmericaPortoAcre, + #[sea_orm(string_value = "America/Porto_Velho")] + AmericaPortoVelho, + #[sea_orm(string_value = "America/Puerto_Rico")] + AmericaPuertoRico, + #[sea_orm(string_value = "America/Punta_Arenas")] + AmericaPuntaArenas, + #[sea_orm(string_value = "America/Rainy_River")] + AmericaRainyRiver, + #[sea_orm(string_value = "America/Rankin_Inlet")] + AmericaRankinInlet, + #[sea_orm(string_value = "America/Recife")] + AmericaRecife, + #[sea_orm(string_value = "America/Regina")] + AmericaRegina, + #[sea_orm(string_value = "America/Resolute")] + AmericaResolute, + #[sea_orm(string_value = "America/Rio_Branco")] + AmericaRioBranco, + #[sea_orm(string_value = "America/Rosario")] + AmericaRosario, + #[sea_orm(string_value = "America/Santa_Isabel")] + AmericaSantaIsabel, + #[sea_orm(string_value = "America/Santarem")] + AmericaSantarem, + #[sea_orm(string_value = "America/Santiago")] + AmericaSantiago, + #[sea_orm(string_value = "America/Santo_Domingo")] + AmericaSantoDomingo, + #[sea_orm(string_value = "America/Sao_Paulo")] + AmericaSaoPaulo, + #[sea_orm(string_value = "America/Scoresbysund")] + AmericaScoresbysund, + #[sea_orm(string_value = "America/Shiprock")] + AmericaShiprock, + #[sea_orm(string_value = "America/Sitka")] + AmericaSitka, + #[sea_orm(string_value = "America/St_Barthelemy")] + AmericaStBarthelemy, + #[sea_orm(string_value = "America/St_Johns")] + AmericaStJohns, + #[sea_orm(string_value = "America/St_Kitts")] + AmericaStKitts, + #[sea_orm(string_value = "America/St_Lucia")] + AmericaStLucia, + #[sea_orm(string_value = "America/St_Thomas")] + AmericaStThomas, + #[sea_orm(string_value = "America/St_Vincent")] + AmericaStVincent, + #[sea_orm(string_value = "America/Swift_Current")] + AmericaSwiftCurrent, + #[sea_orm(string_value = "America/Tegucigalpa")] + AmericaTegucigalpa, + #[sea_orm(string_value = "America/Thule")] + AmericaThule, + #[sea_orm(string_value = "America/Thunder_Bay")] + AmericaThunderBay, + #[sea_orm(string_value = "America/Tijuana")] + AmericaTijuana, + #[sea_orm(string_value = "America/Toronto")] + AmericaToronto, + #[sea_orm(string_value = "America/Tortola")] + AmericaTortola, + #[sea_orm(string_value = "America/Vancouver")] + AmericaVancouver, + #[sea_orm(string_value = "America/Virgin")] + AmericaVirgin, + #[sea_orm(string_value = "America/Whitehorse")] + AmericaWhitehorse, + #[sea_orm(string_value = "America/Winnipeg")] + AmericaWinnipeg, + #[sea_orm(string_value = "America/Yakutat")] + AmericaYakutat, + #[sea_orm(string_value = "America/Yellowknife")] + AmericaYellowknife, + #[sea_orm(string_value = "Antarctica/Casey")] + AntarcticaCasey, + #[sea_orm(string_value = "Antarctica/Davis")] + AntarcticaDavis, + #[sea_orm(string_value = "Antarctica/DumontDUrville")] + AntarcticaDumontDUrville, + #[sea_orm(string_value = "Antarctica/Macquarie")] + AntarcticaMacquarie, + #[sea_orm(string_value = "Antarctica/Mawson")] + AntarcticaMawson, + #[sea_orm(string_value = "Antarctica/McMurdo")] + AntarcticaMcMurdo, + #[sea_orm(string_value = "Antarctica/Palmer")] + AntarcticaPalmer, + #[sea_orm(string_value = "Antarctica/Rothera")] + AntarcticaRothera, + #[sea_orm(string_value = "Antarctica/South_Pole")] + AntarcticaSouthPole, + #[sea_orm(string_value = "Antarctica/Syowa")] + AntarcticaSyowa, + #[sea_orm(string_value = "Antarctica/Troll")] + AntarcticaTroll, + #[sea_orm(string_value = "Antarctica/Vostok")] + AntarcticaVostok, + #[sea_orm(string_value = "Arctic/Longyearbyen")] + ArcticLongyearbyen, + #[sea_orm(string_value = "Asia/Aden")] + AsiaAden, + #[sea_orm(string_value = "Asia/Almaty")] + AsiaAlmaty, + #[sea_orm(string_value = "Asia/Amman")] + AsiaAmman, + #[sea_orm(string_value = "Asia/Anadyr")] + AsiaAnadyr, + #[sea_orm(string_value = "Asia/Aqtau")] + AsiaAqtau, + #[sea_orm(string_value = "Asia/Aqtobe")] + AsiaAqtobe, + #[sea_orm(string_value = "Asia/Ashgabat")] + AsiaAshgabat, + #[sea_orm(string_value = "Asia/Ashkhabad")] + AsiaAshkhabad, + #[sea_orm(string_value = "Asia/Atyrau")] + AsiaAtyrau, + #[sea_orm(string_value = "Asia/Baghdad")] + AsiaBaghdad, + #[sea_orm(string_value = "Asia/Bahrain")] + AsiaBahrain, + #[sea_orm(string_value = "Asia/Baku")] + AsiaBaku, + #[sea_orm(string_value = "Asia/Bangkok")] + AsiaBangkok, + #[sea_orm(string_value = "Asia/Barnaul")] + AsiaBarnaul, + #[sea_orm(string_value = "Asia/Beirut")] + AsiaBeirut, + #[sea_orm(string_value = "Asia/Bishkek")] + AsiaBishkek, + #[sea_orm(string_value = "Asia/Brunei")] + AsiaBrunei, + #[sea_orm(string_value = "Asia/Calcutta")] + AsiaCalcutta, + #[sea_orm(string_value = "Asia/Chita")] + AsiaChita, + #[sea_orm(string_value = "Asia/Choibalsan")] + AsiaChoibalsan, + #[sea_orm(string_value = "Asia/Chongqing")] + AsiaChongqing, + #[sea_orm(string_value = "Asia/Chungking")] + AsiaChungking, + #[sea_orm(string_value = "Asia/Colombo")] + AsiaColombo, + #[sea_orm(string_value = "Asia/Dacca")] + AsiaDacca, + #[sea_orm(string_value = "Asia/Damascus")] + AsiaDamascus, + #[sea_orm(string_value = "Asia/Dhaka")] + AsiaDhaka, + #[sea_orm(string_value = "Asia/Dili")] + AsiaDili, + #[sea_orm(string_value = "Asia/Dubai")] + AsiaDubai, + #[sea_orm(string_value = "Asia/Dushanbe")] + AsiaDushanbe, + #[sea_orm(string_value = "Asia/Famagusta")] + AsiaFamagusta, + #[sea_orm(string_value = "Asia/Gaza")] + AsiaGaza, + #[sea_orm(string_value = "Asia/Harbin")] + AsiaHarbin, + #[sea_orm(string_value = "Asia/Hebron")] + AsiaHebron, + #[sea_orm(string_value = "Asia/Ho_Chi_Minh")] + AsiaHoChiMinh, + #[sea_orm(string_value = "Asia/Hong_Kong")] + AsiaHongKong, + #[sea_orm(string_value = "Asia/Hovd")] + AsiaHovd, + #[sea_orm(string_value = "Asia/Irkutsk")] + AsiaIrkutsk, + #[sea_orm(string_value = "Asia/Istanbul")] + AsiaIstanbul, + #[sea_orm(string_value = "Asia/Jakarta")] + AsiaJakarta, + #[sea_orm(string_value = "Asia/Jayapura")] + AsiaJayapura, + #[sea_orm(string_value = "Asia/Jerusalem")] + AsiaJerusalem, + #[sea_orm(string_value = "Asia/Kabul")] + AsiaKabul, + #[sea_orm(string_value = "Asia/Kamchatka")] + AsiaKamchatka, + #[sea_orm(string_value = "Asia/Karachi")] + AsiaKarachi, + #[sea_orm(string_value = "Asia/Kashgar")] + AsiaKashgar, + #[sea_orm(string_value = "Asia/Kathmandu")] + AsiaKathmandu, + #[sea_orm(string_value = "Asia/Katmandu")] + AsiaKatmandu, + #[sea_orm(string_value = "Asia/Khandyga")] + AsiaKhandyga, + #[sea_orm(string_value = "Asia/Kolkata")] + AsiaKolkata, + #[sea_orm(string_value = "Asia/Krasnoyarsk")] + AsiaKrasnoyarsk, + #[sea_orm(string_value = "Asia/Kuala_Lumpur")] + AsiaKualaLumpur, + #[sea_orm(string_value = "Asia/Kuching")] + AsiaKuching, + #[sea_orm(string_value = "Asia/Kuwait")] + AsiaKuwait, + #[sea_orm(string_value = "Asia/Macao")] + AsiaMacao, + #[sea_orm(string_value = "Asia/Macau")] + AsiaMacau, + #[sea_orm(string_value = "Asia/Magadan")] + AsiaMagadan, + #[sea_orm(string_value = "Asia/Makassar")] + AsiaMakassar, + #[sea_orm(string_value = "Asia/Manila")] + AsiaManila, + #[sea_orm(string_value = "Asia/Muscat")] + AsiaMuscat, + #[sea_orm(string_value = "Asia/Nicosia")] + AsiaNicosia, + #[sea_orm(string_value = "Asia/Novokuznetsk")] + AsiaNovokuznetsk, + #[sea_orm(string_value = "Asia/Novosibirsk")] + AsiaNovosibirsk, + #[sea_orm(string_value = "Asia/Omsk")] + AsiaOmsk, + #[sea_orm(string_value = "Asia/Oral")] + AsiaOral, + #[sea_orm(string_value = "Asia/Phnom_Penh")] + AsiaPhnomPenh, + #[sea_orm(string_value = "Asia/Pontianak")] + AsiaPontianak, + #[sea_orm(string_value = "Asia/Pyongyang")] + AsiaPyongyang, + #[sea_orm(string_value = "Asia/Qatar")] + AsiaQatar, + #[sea_orm(string_value = "Asia/Qostanay")] + AsiaQostanay, + #[sea_orm(string_value = "Asia/Qyzylorda")] + AsiaQyzylorda, + #[sea_orm(string_value = "Asia/Rangoon")] + AsiaRangoon, + #[sea_orm(string_value = "Asia/Riyadh")] + AsiaRiyadh, + #[sea_orm(string_value = "Asia/Saigon")] + AsiaSaigon, + #[sea_orm(string_value = "Asia/Sakhalin")] + AsiaSakhalin, + #[sea_orm(string_value = "Asia/Samarkand")] + AsiaSamarkand, + #[sea_orm(string_value = "Asia/Seoul")] + AsiaSeoul, + #[sea_orm(string_value = "Asia/Shanghai")] + AsiaShanghai, + #[sea_orm(string_value = "Asia/Singapore")] + AsiaSingapore, + #[sea_orm(string_value = "Asia/Srednekolymsk")] + AsiaSrednekolymsk, + #[sea_orm(string_value = "Asia/Taipei")] + AsiaTaipei, + #[sea_orm(string_value = "Asia/Tashkent")] + AsiaTashkent, + #[sea_orm(string_value = "Asia/Tbilisi")] + AsiaTbilisi, + #[sea_orm(string_value = "Asia/Tehran")] + AsiaTehran, + #[sea_orm(string_value = "Asia/Tel_Aviv")] + AsiaTelAviv, + #[sea_orm(string_value = "Asia/Thimbu")] + AsiaThimbu, + #[sea_orm(string_value = "Asia/Thimphu")] + AsiaThimphu, + #[sea_orm(string_value = "Asia/Tokyo")] + AsiaTokyo, + #[sea_orm(string_value = "Asia/Tomsk")] + AsiaTomsk, + #[sea_orm(string_value = "Asia/Ujung_Pandang")] + AsiaUjungPandang, + #[sea_orm(string_value = "Asia/Ulaanbaatar")] + AsiaUlaanbaatar, + #[sea_orm(string_value = "Asia/Ulan_Bator")] + AsiaUlanBator, + #[sea_orm(string_value = "Asia/Urumqi")] + AsiaUrumqi, + #[sea_orm(string_value = "Asia/Ust-Nera")] + AsiaUstNera, + #[sea_orm(string_value = "Asia/Vientiane")] + AsiaVientiane, + #[sea_orm(string_value = "Asia/Vladivostok")] + AsiaVladivostok, + #[sea_orm(string_value = "Asia/Yakutsk")] + AsiaYakutsk, + #[sea_orm(string_value = "Asia/Yangon")] + AsiaYangon, + #[sea_orm(string_value = "Asia/Yekaterinburg")] + AsiaYekaterinburg, + #[sea_orm(string_value = "Asia/Yerevan")] + AsiaYerevan, + #[sea_orm(string_value = "Atlantic/Azores")] + AtlanticAzores, + #[sea_orm(string_value = "Atlantic/Bermuda")] + AtlanticBermuda, + #[sea_orm(string_value = "Atlantic/Canary")] + AtlanticCanary, + #[sea_orm(string_value = "Atlantic/Cape_Verde")] + AtlanticCapeVerde, + #[sea_orm(string_value = "Atlantic/Faeroe")] + AtlanticFaeroe, + #[sea_orm(string_value = "Atlantic/Faroe")] + AtlanticFaroe, + #[sea_orm(string_value = "Atlantic/Jan_Mayen")] + AtlanticJanMayen, + #[sea_orm(string_value = "Atlantic/Madeira")] + AtlanticMadeira, + #[sea_orm(string_value = "Atlantic/Reykjavik")] + AtlanticReykjavik, + #[sea_orm(string_value = "Atlantic/South_Georgia")] + AtlanticSouthGeorgia, + #[sea_orm(string_value = "Atlantic/St_Helena")] + AtlanticStHelena, + #[sea_orm(string_value = "Atlantic/Stanley")] + AtlanticStanley, + #[sea_orm(string_value = "Australia/ACT")] + AustraliaAct, + #[sea_orm(string_value = "Australia/Adelaide")] + AustraliaAdelaide, + #[sea_orm(string_value = "Australia/Brisbane")] + AustraliaBrisbane, + #[sea_orm(string_value = "Australia/Broken_Hill")] + AustraliaBrokenHill, + #[sea_orm(string_value = "Australia/Canberra")] + AustraliaCanberra, + #[sea_orm(string_value = "Australia/Currie")] + AustraliaCurrie, + #[sea_orm(string_value = "Australia/Darwin")] + AustraliaDarwin, + #[sea_orm(string_value = "Australia/Eucla")] + AustraliaEucla, + #[sea_orm(string_value = "Australia/Hobart")] + AustraliaHobart, + #[sea_orm(string_value = "Australia/LHI")] + AustraliaLhi, + #[sea_orm(string_value = "Australia/Lindeman")] + AustraliaLindeman, + #[sea_orm(string_value = "Australia/Lord_Howe")] + AustraliaLordHowe, + #[sea_orm(string_value = "Australia/Melbourne")] + AustraliaMelbourne, + #[sea_orm(string_value = "Australia/NSW")] + AustraliaNsw, + #[sea_orm(string_value = "Australia/North")] + AustraliaNorth, + #[sea_orm(string_value = "Australia/Perth")] + AustraliaPerth, + #[sea_orm(string_value = "Australia/Queensland")] + AustraliaQueensland, + #[sea_orm(string_value = "Australia/South")] + AustraliaSouth, + #[sea_orm(string_value = "Australia/Sydney")] + AustraliaSydney, + #[sea_orm(string_value = "Australia/Tasmania")] + AustraliaTasmania, + #[sea_orm(string_value = "Australia/Victoria")] + AustraliaVictoria, + #[sea_orm(string_value = "Australia/West")] + AustraliaWest, + #[sea_orm(string_value = "Australia/Yancowinna")] + AustraliaYancowinna, + #[sea_orm(string_value = "Brazil/Acre")] + BrazilAcre, + #[sea_orm(string_value = "Brazil/DeNoronha")] + BrazilDeNoronha, + #[sea_orm(string_value = "Brazil/East")] + BrazilEast, + #[sea_orm(string_value = "Brazil/West")] + BrazilWest, + #[sea_orm(string_value = "CET")] + Cet, + #[sea_orm(string_value = "CST6CDT")] + Cst6cdt, + #[sea_orm(string_value = "Canada/Atlantic")] + CanadaAtlantic, + #[sea_orm(string_value = "Canada/Central")] + CanadaCentral, + #[sea_orm(string_value = "Canada/Eastern")] + CanadaEastern, + #[sea_orm(string_value = "Canada/Mountain")] + CanadaMountain, + #[sea_orm(string_value = "Canada/Newfoundland")] + CanadaNewfoundland, + #[sea_orm(string_value = "Canada/Pacific")] + CanadaPacific, + #[sea_orm(string_value = "Canada/Saskatchewan")] + CanadaSaskatchewan, + #[sea_orm(string_value = "Canada/Yukon")] + CanadaYukon, + #[sea_orm(string_value = "Chile/Continental")] + ChileContinental, + #[sea_orm(string_value = "Chile/EasterIsland")] + ChileEasterIsland, + #[sea_orm(string_value = "Cuba")] + Cuba, + #[sea_orm(string_value = "EET")] + Eet, + #[sea_orm(string_value = "EST")] + Est, + #[sea_orm(string_value = "EST5EDT")] + Est5edt, + #[sea_orm(string_value = "Egypt")] + Egypt, + #[sea_orm(string_value = "Eire")] + Eire, + #[sea_orm(string_value = "Etc/GMT")] + EtcGmt, + #[sea_orm(string_value = "Etc/GMT+0")] + EtcGmt0, + #[sea_orm(string_value = "Etc/GMT+1")] + EtcGmt1, + #[sea_orm(string_value = "Etc/GMT+10")] + EtcGmt10, + #[sea_orm(string_value = "Etc/GMT+11")] + EtcGmt11, + #[sea_orm(string_value = "Etc/GMT+12")] + EtcGmt12, + #[sea_orm(string_value = "Etc/GMT+2")] + EtcGmt2, + #[sea_orm(string_value = "Etc/GMT+3")] + EtcGmt3, + #[sea_orm(string_value = "Etc/GMT+4")] + EtcGmt4, + #[sea_orm(string_value = "Etc/GMT+5")] + EtcGmt5, + #[sea_orm(string_value = "Etc/GMT+6")] + EtcGmt6, + #[sea_orm(string_value = "Etc/GMT+7")] + EtcGmt7, + #[sea_orm(string_value = "Etc/GMT+8")] + EtcGmt8, + #[sea_orm(string_value = "Etc/GMT+9")] + EtcGmt9, + #[sea_orm(string_value = "Etc/GMT-0")] + EtcGmt0, + #[sea_orm(string_value = "Etc/GMT-1")] + EtcGmt1, + #[sea_orm(string_value = "Etc/GMT-10")] + EtcGmt10, + #[sea_orm(string_value = "Etc/GMT-11")] + EtcGmt11, + #[sea_orm(string_value = "Etc/GMT-12")] + EtcGmt12, + #[sea_orm(string_value = "Etc/GMT-13")] + EtcGmt13, + #[sea_orm(string_value = "Etc/GMT-14")] + EtcGmt14, + #[sea_orm(string_value = "Etc/GMT-2")] + EtcGmt2, + #[sea_orm(string_value = "Etc/GMT-3")] + EtcGmt3, + #[sea_orm(string_value = "Etc/GMT-4")] + EtcGmt4, + #[sea_orm(string_value = "Etc/GMT-5")] + EtcGmt5, + #[sea_orm(string_value = "Etc/GMT-6")] + EtcGmt6, + #[sea_orm(string_value = "Etc/GMT-7")] + EtcGmt7, + #[sea_orm(string_value = "Etc/GMT-8")] + EtcGmt8, + #[sea_orm(string_value = "Etc/GMT-9")] + EtcGmt9, + #[sea_orm(string_value = "Etc/GMT0")] + EtcGmt0, + #[sea_orm(string_value = "Etc/Greenwich")] + EtcGreenwich, + #[sea_orm(string_value = "Etc/UCT")] + EtcUct, + #[sea_orm(string_value = "Etc/UTC")] + EtcUtc, + #[sea_orm(string_value = "Etc/Universal")] + EtcUniversal, + #[sea_orm(string_value = "Etc/Zulu")] + EtcZulu, + #[sea_orm(string_value = "Europe/Amsterdam")] + EuropeAmsterdam, + #[sea_orm(string_value = "Europe/Andorra")] + EuropeAndorra, + #[sea_orm(string_value = "Europe/Astrakhan")] + EuropeAstrakhan, + #[sea_orm(string_value = "Europe/Athens")] + EuropeAthens, + #[sea_orm(string_value = "Europe/Belfast")] + EuropeBelfast, + #[sea_orm(string_value = "Europe/Belgrade")] + EuropeBelgrade, + #[sea_orm(string_value = "Europe/Berlin")] + EuropeBerlin, + #[sea_orm(string_value = "Europe/Bratislava")] + EuropeBratislava, + #[sea_orm(string_value = "Europe/Brussels")] + EuropeBrussels, + #[sea_orm(string_value = "Europe/Bucharest")] + EuropeBucharest, + #[sea_orm(string_value = "Europe/Budapest")] + EuropeBudapest, + #[sea_orm(string_value = "Europe/Busingen")] + EuropeBusingen, + #[sea_orm(string_value = "Europe/Chisinau")] + EuropeChisinau, + #[sea_orm(string_value = "Europe/Copenhagen")] + EuropeCopenhagen, + #[sea_orm(string_value = "Europe/Dublin")] + EuropeDublin, + #[sea_orm(string_value = "Europe/Gibraltar")] + EuropeGibraltar, + #[sea_orm(string_value = "Europe/Guernsey")] + EuropeGuernsey, + #[sea_orm(string_value = "Europe/Helsinki")] + EuropeHelsinki, + #[sea_orm(string_value = "Europe/Isle_of_Man")] + EuropeIsleOfMan, + #[sea_orm(string_value = "Europe/Istanbul")] + EuropeIstanbul, + #[sea_orm(string_value = "Europe/Jersey")] + EuropeJersey, + #[sea_orm(string_value = "Europe/Kaliningrad")] + EuropeKaliningrad, + #[sea_orm(string_value = "Europe/Kiev")] + EuropeKiev, + #[sea_orm(string_value = "Europe/Kirov")] + EuropeKirov, + #[sea_orm(string_value = "Europe/Lisbon")] + EuropeLisbon, + #[sea_orm(string_value = "Europe/Ljubljana")] + EuropeLjubljana, + #[sea_orm(string_value = "Europe/London")] + EuropeLondon, + #[sea_orm(string_value = "Europe/Luxembourg")] + EuropeLuxembourg, + #[sea_orm(string_value = "Europe/Madrid")] + EuropeMadrid, + #[sea_orm(string_value = "Europe/Malta")] + EuropeMalta, + #[sea_orm(string_value = "Europe/Mariehamn")] + EuropeMariehamn, + #[sea_orm(string_value = "Europe/Minsk")] + EuropeMinsk, + #[sea_orm(string_value = "Europe/Monaco")] + EuropeMonaco, + #[sea_orm(string_value = "Europe/Moscow")] + EuropeMoscow, + #[sea_orm(string_value = "Europe/Nicosia")] + EuropeNicosia, + #[sea_orm(string_value = "Europe/Oslo")] + EuropeOslo, + #[sea_orm(string_value = "Europe/Paris")] + EuropeParis, + #[sea_orm(string_value = "Europe/Podgorica")] + EuropePodgorica, + #[sea_orm(string_value = "Europe/Prague")] + EuropePrague, + #[sea_orm(string_value = "Europe/Riga")] + EuropeRiga, + #[sea_orm(string_value = "Europe/Rome")] + EuropeRome, + #[sea_orm(string_value = "Europe/Samara")] + EuropeSamara, + #[sea_orm(string_value = "Europe/San_Marino")] + EuropeSanMarino, + #[sea_orm(string_value = "Europe/Sarajevo")] + EuropeSarajevo, + #[sea_orm(string_value = "Europe/Saratov")] + EuropeSaratov, + #[sea_orm(string_value = "Europe/Simferopol")] + EuropeSimferopol, + #[sea_orm(string_value = "Europe/Skopje")] + EuropeSkopje, + #[sea_orm(string_value = "Europe/Sofia")] + EuropeSofia, + #[sea_orm(string_value = "Europe/Stockholm")] + EuropeStockholm, + #[sea_orm(string_value = "Europe/Tallinn")] + EuropeTallinn, + #[sea_orm(string_value = "Europe/Tirane")] + EuropeTirane, + #[sea_orm(string_value = "Europe/Tiraspol")] + EuropeTiraspol, + #[sea_orm(string_value = "Europe/Ulyanovsk")] + EuropeUlyanovsk, + #[sea_orm(string_value = "Europe/Uzhgorod")] + EuropeUzhgorod, + #[sea_orm(string_value = "Europe/Vaduz")] + EuropeVaduz, + #[sea_orm(string_value = "Europe/Vatican")] + EuropeVatican, + #[sea_orm(string_value = "Europe/Vienna")] + EuropeVienna, + #[sea_orm(string_value = "Europe/Vilnius")] + EuropeVilnius, + #[sea_orm(string_value = "Europe/Volgograd")] + EuropeVolgograd, + #[sea_orm(string_value = "Europe/Warsaw")] + EuropeWarsaw, + #[sea_orm(string_value = "Europe/Zagreb")] + EuropeZagreb, + #[sea_orm(string_value = "Europe/Zaporozhye")] + EuropeZaporozhye, + #[sea_orm(string_value = "Europe/Zurich")] + EuropeZurich, + #[sea_orm(string_value = "GB")] + Gb, + #[sea_orm(string_value = "GB-Eire")] + GbEire, + #[sea_orm(string_value = "GMT")] + Gmt, + #[sea_orm(string_value = "GMT+0")] + Gmt0, + #[sea_orm(string_value = "GMT-0")] + Gmt0, + #[sea_orm(string_value = "GMT0")] + Gmt0, + #[sea_orm(string_value = "Greenwich")] + Greenwich, + #[sea_orm(string_value = "HST")] + Hst, + #[sea_orm(string_value = "Hongkong")] + Hongkong, + #[sea_orm(string_value = "Iceland")] + Iceland, + #[sea_orm(string_value = "Indian/Antananarivo")] + IndianAntananarivo, + #[sea_orm(string_value = "Indian/Chagos")] + IndianChagos, + #[sea_orm(string_value = "Indian/Christmas")] + IndianChristmas, + #[sea_orm(string_value = "Indian/Cocos")] + IndianCocos, + #[sea_orm(string_value = "Indian/Comoro")] + IndianComoro, + #[sea_orm(string_value = "Indian/Kerguelen")] + IndianKerguelen, + #[sea_orm(string_value = "Indian/Mahe")] + IndianMahe, + #[sea_orm(string_value = "Indian/Maldives")] + IndianMaldives, + #[sea_orm(string_value = "Indian/Mauritius")] + IndianMauritius, + #[sea_orm(string_value = "Indian/Mayotte")] + IndianMayotte, + #[sea_orm(string_value = "Indian/Reunion")] + IndianReunion, + #[sea_orm(string_value = "Iran")] + Iran, + #[sea_orm(string_value = "Israel")] + Israel, + #[sea_orm(string_value = "Jamaica")] + Jamaica, + #[sea_orm(string_value = "Japan")] + Japan, + #[sea_orm(string_value = "Kwajalein")] + Kwajalein, + #[sea_orm(string_value = "Libya")] + Libya, + #[sea_orm(string_value = "MET")] + Met, + #[sea_orm(string_value = "MST")] + Mst, + #[sea_orm(string_value = "MST7MDT")] + Mst7mdt, + #[sea_orm(string_value = "Mexico/BajaNorte")] + MexicoBajaNorte, + #[sea_orm(string_value = "Mexico/BajaSur")] + MexicoBajaSur, + #[sea_orm(string_value = "Mexico/General")] + MexicoGeneral, + #[sea_orm(string_value = "NZ")] + Nz, + #[sea_orm(string_value = "NZ-CHAT")] + NzChat, + #[sea_orm(string_value = "Navajo")] + Navajo, + #[sea_orm(string_value = "PRC")] + Prc, + #[sea_orm(string_value = "PST8PDT")] + Pst8pdt, + #[sea_orm(string_value = "Pacific/Apia")] + PacificApia, + #[sea_orm(string_value = "Pacific/Auckland")] + PacificAuckland, + #[sea_orm(string_value = "Pacific/Bougainville")] + PacificBougainville, + #[sea_orm(string_value = "Pacific/Chatham")] + PacificChatham, + #[sea_orm(string_value = "Pacific/Chuuk")] + PacificChuuk, + #[sea_orm(string_value = "Pacific/Easter")] + PacificEaster, + #[sea_orm(string_value = "Pacific/Efate")] + PacificEfate, + #[sea_orm(string_value = "Pacific/Enderbury")] + PacificEnderbury, + #[sea_orm(string_value = "Pacific/Fakaofo")] + PacificFakaofo, + #[sea_orm(string_value = "Pacific/Fiji")] + PacificFiji, + #[sea_orm(string_value = "Pacific/Funafuti")] + PacificFunafuti, + #[sea_orm(string_value = "Pacific/Galapagos")] + PacificGalapagos, + #[sea_orm(string_value = "Pacific/Gambier")] + PacificGambier, + #[sea_orm(string_value = "Pacific/Guadalcanal")] + PacificGuadalcanal, + #[sea_orm(string_value = "Pacific/Guam")] + PacificGuam, + #[sea_orm(string_value = "Pacific/Honolulu")] + PacificHonolulu, + #[sea_orm(string_value = "Pacific/Johnston")] + PacificJohnston, + #[sea_orm(string_value = "Pacific/Kanton")] + PacificKanton, + #[sea_orm(string_value = "Pacific/Kiritimati")] + PacificKiritimati, + #[sea_orm(string_value = "Pacific/Kosrae")] + PacificKosrae, + #[sea_orm(string_value = "Pacific/Kwajalein")] + PacificKwajalein, + #[sea_orm(string_value = "Pacific/Majuro")] + PacificMajuro, + #[sea_orm(string_value = "Pacific/Marquesas")] + PacificMarquesas, + #[sea_orm(string_value = "Pacific/Midway")] + PacificMidway, + #[sea_orm(string_value = "Pacific/Nauru")] + PacificNauru, + #[sea_orm(string_value = "Pacific/Niue")] + PacificNiue, + #[sea_orm(string_value = "Pacific/Norfolk")] + PacificNorfolk, + #[sea_orm(string_value = "Pacific/Noumea")] + PacificNoumea, + #[sea_orm(string_value = "Pacific/Pago_Pago")] + PacificPagoPago, + #[sea_orm(string_value = "Pacific/Palau")] + PacificPalau, + #[sea_orm(string_value = "Pacific/Pitcairn")] + PacificPitcairn, + #[sea_orm(string_value = "Pacific/Pohnpei")] + PacificPohnpei, + #[sea_orm(string_value = "Pacific/Ponape")] + PacificPonape, + #[sea_orm(string_value = "Pacific/Port_Moresby")] + PacificPortMoresby, + #[sea_orm(string_value = "Pacific/Rarotonga")] + PacificRarotonga, + #[sea_orm(string_value = "Pacific/Saipan")] + PacificSaipan, + #[sea_orm(string_value = "Pacific/Samoa")] + PacificSamoa, + #[sea_orm(string_value = "Pacific/Tahiti")] + PacificTahiti, + #[sea_orm(string_value = "Pacific/Tarawa")] + PacificTarawa, + #[sea_orm(string_value = "Pacific/Tongatapu")] + PacificTongatapu, + #[sea_orm(string_value = "Pacific/Truk")] + PacificTruk, + #[sea_orm(string_value = "Pacific/Wake")] + PacificWake, + #[sea_orm(string_value = "Pacific/Wallis")] + PacificWallis, + #[sea_orm(string_value = "Pacific/Yap")] + PacificYap, + #[sea_orm(string_value = "Poland")] + Poland, + #[sea_orm(string_value = "Portugal")] + Portugal, + #[sea_orm(string_value = "ROC")] + Roc, + #[sea_orm(string_value = "ROK")] + Rok, + #[sea_orm(string_value = "Singapore")] + Singapore, + #[sea_orm(string_value = "Turkey")] + Turkey, + #[sea_orm(string_value = "UCT")] + Uct, + #[sea_orm(string_value = "US/Alaska")] + UsAlaska, + #[sea_orm(string_value = "US/Aleutian")] + UsAleutian, + #[sea_orm(string_value = "US/Arizona")] + UsArizona, + #[sea_orm(string_value = "US/Central")] + UsCentral, + #[sea_orm(string_value = "US/East-Indiana")] + UsEastIndiana, + #[sea_orm(string_value = "US/Eastern")] + UsEastern, + #[sea_orm(string_value = "US/Hawaii")] + UsHawaii, + #[sea_orm(string_value = "US/Indiana-Starke")] + UsIndianaStarke, + #[sea_orm(string_value = "US/Michigan")] + UsMichigan, + #[sea_orm(string_value = "US/Mountain")] + UsMountain, + #[sea_orm(string_value = "US/Pacific")] + UsPacific, + #[sea_orm(string_value = "US/Samoa")] + UsSamoa, + #[sea_orm(string_value = "UTC")] + Utc, + #[sea_orm(string_value = "Universal")] + Universal, + #[sea_orm(string_value = "W-SU")] + WSu, + #[sea_orm(string_value = "WET")] + Wet, + #[sea_orm(string_value = "Zulu")] + Zulu, +} diff --git a/models/entity/src/seaql_migrations.rs b/models/entity/src/seaql_migrations.rs new file mode 100644 index 0000000..c32c701 --- /dev/null +++ b/models/entity/src/seaql_migrations.rs @@ -0,0 +1,22 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "seaql_migrations")] +pub struct Model { + #[sea_orm(primary_key, auto_increment = false)] + pub version: String, + pub applied_at: i64, +} + +#[derive(Copy, Clone, Debug, EnumIter)] +pub enum Relation {} + +impl RelationTrait for Relation { + fn def(&self) -> RelationDef { + panic!("No RelationDef") + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/timer.rs b/models/entity/src/timer.rs new file mode 100644 index 0000000..884878d --- /dev/null +++ b/models/entity/src/timer.rs @@ -0,0 +1,36 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "timer")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub start_time: DateTimeUtc, + pub name: String, + pub user_id: Option, + pub guild_id: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::guild::Entity", + from = "Column::GuildId", + to = "super::guild::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Guild2, + #[sea_orm( + belongs_to = "super::guild::Entity", + from = "Column::UserId", + to = "super::guild::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Guild1, +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/todo.rs b/models/entity/src/todo.rs new file mode 100644 index 0000000..49fa768 --- /dev/null +++ b/models/entity/src/todo.rs @@ -0,0 +1,62 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "todo")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub user_id: Option, + pub guild_id: Option, + pub channel_id: Option, + pub value: String, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::channel::Entity", + from = "Column::ChannelId", + to = "super::channel::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Channel, + #[sea_orm( + belongs_to = "super::guild::Entity", + from = "Column::GuildId", + to = "super::guild::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Guild, + #[sea_orm( + belongs_to = "super::user::Entity", + from = "Column::UserId", + to = "super::user::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + User, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Channel.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Guild.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::User.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/entity/src/user.rs b/models/entity/src/user.rs new file mode 100644 index 0000000..099cdd1 --- /dev/null +++ b/models/entity/src/user.rs @@ -0,0 +1,50 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.8.0 + +use sea_orm::entity::prelude::*; + +use super::sea_orm_active_enums::Timezone; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] +#[sea_orm(table_name = "user")] +pub struct Model { + #[sea_orm(primary_key, auto_increment = false)] + pub id: i64, + pub dm_channel: i64, + pub timezone: Timezone, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::channel::Entity", + from = "Column::DmChannel", + to = "super::channel::Column::Id", + on_update = "NoAction", + on_delete = "Cascade" + )] + Channel, + #[sea_orm(has_many = "super::reminder::Entity")] + Reminder, + #[sea_orm(has_many = "super::todo::Entity")] + Todo, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Channel.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Reminder.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Todo.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/models/migration/Cargo.lock b/models/migration/Cargo.lock new file mode 100644 index 0000000..33a43d5 --- /dev/null +++ b/models/migration/Cargo.lock @@ -0,0 +1,2400 @@ +# This file is automatically @generated by Cargo. +# 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 = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-attributes" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c290043c9a95b05d45e952fb6383c67bcb61471f60cfa21e890dba6654234f43" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-mutex", + "blocking", + "futures-lite", + "num_cpus", + "once_cell", + "tokio", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-std" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" +dependencies = [ + "async-attributes", + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "num_cpus", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-task" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" + +[[package]] +name = "async-trait" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atoi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[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", +] + +[[package]] +name = "base-x" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc19a4937b4fbd3fe3379793130e42060d10627a360f2127802b10b87e7baf74" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "serde", + "time 0.1.44", + "winapi", +] + +[[package]] +name = "chrono-tz" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58549f1842da3080ce63002102d5bc954c7bc843d4f47818e642abdc36253552" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db058d493fb2f65f41861bfed7e3fe6335264a9f0f92710cab5bdf01fef09069" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "const_fn" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" + +[[package]] +name = "crossbeam-queue" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +dependencies = [ + "cfg-if", + "lazy_static", +] + +[[package]] +name = "crypto-common" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "entity" +version = "0.1.0" +dependencies = [ + "chrono-tz", + "sea-orm", +] + +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[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.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62007592ac46aa7c2b6416f7deb9a8a8f63a01e0f1d6e1787d5630170db2b63e" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gloo-timers" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +dependencies = [ + "hashbrown", +] + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "js-sys" +version = "0.3.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.125" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", + "value-bag", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "md-5" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" +dependencies = [ + "digest", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "migration" +version = "0.1.0" +dependencies = [ + "chrono-tz", + "entity", + "sea-orm-migration", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" + +[[package]] +name = "openssl" +version = "0.10.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +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.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5fd19fb3e0a8191c1e34935718976a3e70c112ab9a24af6d7cadccd9d90bc0" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "ouroboros" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f31a3b678685b150cba82b702dcdc5e155893f63610cf388d30cd988d4ca2bf" +dependencies = [ + "aliasable", + "ouroboros_macro", + "stable_deref_trait", +] + +[[package]] +name = "ouroboros_macro" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "084fd65d5dd8b3772edccb5ffd1e4b7eba43897ecd0f9401e330e8c542959408" +dependencies = [ + "Inflector", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parse-zoneinfo" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +dependencies = [ + "regex", +] + +[[package]] +name = "paste" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", + "uncased", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if", + "libc", + "log", + "wepoll-ffi", + "winapi", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro2" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "rust_decimal" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22dc69eadbf0ee2110b8d20418c0c6edbaefec2811c4963dc17b6344e11fe0f8" +dependencies = [ + "arrayvec", + "num-traits", + "serde", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + +[[package]] +name = "ryu" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +dependencies = [ + "lazy_static", + "winapi", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sea-orm" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51de529763804dd4f74c133055f53eccdda2221bdded94351009be28cc80d2fb" +dependencies = [ + "async-stream", + "async-trait", + "chrono", + "futures", + "futures-util", + "once_cell", + "ouroboros", + "rust_decimal", + "sea-orm-macros", + "sea-query", + "sea-strum", + "serde", + "serde_json", + "sqlx", + "time 0.2.27", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "sea-orm-cli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca862fdba12c753bffba9c9adf95d3d3f5dcc82fd589b12faeee7068bb173d5" +dependencies = [ + "async-std", + "chrono", + "clap", + "dotenv", + "regex", + "sea-schema", + "tracing", + "tracing-subscriber", + "url", +] + +[[package]] +name = "sea-orm-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9378e21366b119d281489013c8170c49972fd3709c2155eb4504a913715d2d" +dependencies = [ + "bae", + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sea-orm-migration" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6be15a93dc65a67bb3615fc0fe45c22581b25b27123520e18fb66cd87f429f4c" +dependencies = [ + "async-std", + "async-trait", + "clap", + "dotenv", + "sea-orm", + "sea-orm-cli", + "sea-schema", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "sea-query" +version = "0.24.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0fa62db5ae33dfc61e805b0b0c9d579c3733f1ed90326b3779f5b38f30fa2a" +dependencies = [ + "chrono", + "rust_decimal", + "sea-query-derive", + "sea-query-driver", + "serde_json", + "time 0.2.27", + "uuid", +] + +[[package]] +name = "sea-query-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cdc022b4f606353fe5dc85b09713a04e433323b70163e81513b141c6ae6eb5" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", + "thiserror", +] + +[[package]] +name = "sea-query-driver" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3953baee94dcb90f0e19e8b4b91b91e9394867b0fc1886d0221cfc6d0439f5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sea-schema" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fea4b9dccc8b0667f108de2d09bdabd42a137b8437de092374a4e36de8c12f" +dependencies = [ + "futures", + "sea-query", + "sea-schema-derive", +] + +[[package]] +name = "sea-schema-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56821b7076f5096b8f726e2791ad255a99c82498e08ec477a65a96c461ff1927" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sea-strum" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "391d06a6007842cfe79ac6f7f53911b76dfd69fc9a6769f1cf6569d12ce20e1b" +dependencies = [ + "sea-strum_macros", +] + +[[package]] +name = "sea-strum_macros" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b4397b825df6ccf1e98bcdabef3bbcfc47ff5853983467850eeab878384f21" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "sqlformat" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" +dependencies = [ + "itertools", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b" +dependencies = [ + "sqlx-core", + "sqlx-macros", +] + +[[package]] +name = "sqlx-core" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5" +dependencies = [ + "ahash", + "atoi", + "base64", + "bitflags", + "byteorder", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "dirs", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-util", + "hashlink", + "hex", + "hkdf", + "hmac", + "indexmap", + "itoa", + "libc", + "log", + "md-5", + "memchr", + "num-bigint", + "once_cell", + "paste", + "percent-encoding", + "rand", + "rust_decimal", + "serde", + "serde_json", + "sha-1", + "sha2", + "smallvec", + "sqlformat", + "sqlx-rt", + "stringprep", + "thiserror", + "time 0.2.27", + "tokio-stream", + "url", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-macros" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1" +dependencies = [ + "dotenv", + "either", + "heck 0.4.0", + "once_cell", + "proc-macro2", + "quote", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-rt", + "syn", + "url", +] + +[[package]] +name = "sqlx-rt" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae" +dependencies = [ + "native-tls", + "once_cell", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "standback" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" +dependencies = [ + "version_check", +] + +[[package]] +name = "stdweb" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" + +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" +dependencies = [ + "const_fn", + "libc", + "standback", + "stdweb", + "time-macros", + "version_check", + "winapi", +] + +[[package]] +name = "time-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" +dependencies = [ + "proc-macro-hack", + "time-macros-impl", +] + +[[package]] +name = "time-macros-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "standback", + "syn", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +dependencies = [ + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "pin-project-lite", + "socket2", + "winapi", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tracing" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +dependencies = [ + "lazy_static", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596" +dependencies = [ + "ansi_term", + "lazy_static", + "matchers", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uncased" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" + +[[package]] +name = "web-sys" +version = "0.3.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + +[[package]] +name = "whoami" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524b58fa5a20a2fb3014dd6358b70e6579692a56ef6fce928834e488f42f65e8" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/models/migration/Cargo.toml b/models/migration/Cargo.toml new file mode 100644 index 0000000..4e0f1e6 --- /dev/null +++ b/models/migration/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "migration" +version = "0.1.0" +edition = "2021" +publish = false + +[lib] +name = "migration" +path = "src/lib.rs" + +[dependencies] +entity = { path = "../entity" } +chrono-tz = "^0.6" + +[dependencies.sea-orm-migration] +version = "^0.8.0" diff --git a/models/migration/README.md b/models/migration/README.md new file mode 100644 index 0000000..963caae --- /dev/null +++ b/models/migration/README.md @@ -0,0 +1,37 @@ +# Running Migrator CLI + +- Apply all pending migrations + ```sh + cargo run + ``` + ```sh + cargo run -- up + ``` +- Apply first 10 pending migrations + ```sh + cargo run -- up -n 10 + ``` +- Rollback last applied migrations + ```sh + cargo run -- down + ``` +- Rollback last 10 applied migrations + ```sh + cargo run -- down -n 10 + ``` +- Drop all tables from the database, then reapply all migrations + ```sh + cargo run -- fresh + ``` +- Rollback all applied migrations, then reapply all migrations + ```sh + cargo run -- refresh + ``` +- Rollback all applied migrations + ```sh + cargo run -- reset + ``` +- Check the status of all migrations + ```sh + cargo run -- status + ``` diff --git a/models/migration/src/lib.rs b/models/migration/src/lib.rs new file mode 100644 index 0000000..2c605af --- /dev/null +++ b/models/migration/src/lib.rs @@ -0,0 +1,12 @@ +pub use sea_orm_migration::prelude::*; + +mod m20220101_000001_create_table; + +pub struct Migrator; + +#[async_trait::async_trait] +impl MigratorTrait for Migrator { + fn migrations() -> Vec> { + vec![Box::new(m20220101_000001_create_table::Migration)] + } +} diff --git a/models/migration/src/m20220101_000001_create_table.rs b/models/migration/src/m20220101_000001_create_table.rs new file mode 100644 index 0000000..c00e67e --- /dev/null +++ b/models/migration/src/m20220101_000001_create_table.rs @@ -0,0 +1,553 @@ +use chrono_tz::{Tz, TZ_VARIANTS}; +use sea_orm_migration::prelude::*; + +use crate::extension::postgres::Type; + +pub struct Migration; + +impl MigrationName for Migration { + fn name(&self) -> &str { + "m20220101_000001_create_table" + } +} + +#[derive(Iden)] +pub enum Guild { + Table, + Id, +} + +#[derive(Iden)] +pub enum Channel { + Table, + Id, + GuildId, + Nudge, + WebhookId, + WebhookToken, + Paused, + PausedUntil, +} + +#[derive(Iden)] +pub enum User { + Table, + Id, + DmChannel, + Timezone, +} + +#[derive(Iden)] +pub enum Reminder { + Table, + Id, + Uid, + Name, + ChannelId, + UtcTime, + Timezone, + IntervalSeconds, + IntervalMonths, + Enabled, + Expires, + Username, + Avatar, + Content, + Tts, + Attachment, + AttachmentName, + EmbedTitle, + EmbedDescription, + EmbedImageUrl, + EmbedThumbnailUrl, + EmbedFooter, + EmbedFooterUrl, + EmbedAuthor, + EmbedAuthorUrl, + EmbedColor, + EmbedFields, + SetAt, + SetBy, +} + +#[derive(Iden)] +pub enum ReminderTemplate { + Table, + Id, + GuildId, + Name, + Username, + Avatar, + Content, + Tts, + Attachment, + AttachmentName, + EmbedTitle, + EmbedDescription, + EmbedImageUrl, + EmbedThumbnailUrl, + EmbedFooter, + EmbedFooterUrl, + EmbedAuthor, + EmbedAuthorUrl, + EmbedColor, + EmbedFields, +} + +#[derive(Iden)] +pub enum Timer { + Table, + Id, + StartTime, + Name, + UserId, + GuildId, +} + +#[derive(Iden)] +pub enum Todo { + Table, + Id, + UserId, + GuildId, + ChannelId, + Value, +} + +#[derive(Iden)] +pub enum CommandMacro { + Table, + Id, + GuildId, + Name, + Description, + Commands, +} + +pub enum Timezone { + Type, + Tz(Tz), +} + +impl Iden for Timezone { + fn unquoted(&self, s: &mut dyn Write) { + write!( + s, + "{}", + match self { + Self::Type => "timezone".to_string(), + Self::Tz(tz) => tz.to_string(), + } + ) + .unwrap(); + } +} + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .create_type( + Type::create() + .as_enum(Timezone::Type) + .values(TZ_VARIANTS.iter().map(|tz| Timezone::Tz(tz.to_owned()))) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(Guild::Table) + .if_not_exists() + .col(ColumnDef::new(Guild::Id).big_integer().not_null().primary_key()) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(Channel::Table) + .if_not_exists() + .col(ColumnDef::new(Channel::Id).big_integer().not_null().primary_key()) + .col(ColumnDef::new(Channel::GuildId).big_integer()) + .col(ColumnDef::new(Channel::Nudge).integer().not_null().default(0)) + .col(ColumnDef::new(Channel::WebhookId).big_integer()) + .col(ColumnDef::new(Channel::WebhookToken).string()) + .col(ColumnDef::new(Channel::Paused).boolean().not_null().default(false)) + .col(ColumnDef::new(Channel::PausedUntil).date_time()) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_channel_guild") + .from(Channel::Table, Channel::GuildId) + .to(Guild::Table, Guild::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(User::Table) + .if_not_exists() + .col(ColumnDef::new(User::Id).big_integer().not_null().primary_key()) + .col(ColumnDef::new(User::DmChannel).big_integer().not_null()) + .col( + ColumnDef::new(User::Timezone) + .custom(Timezone::Type) + .not_null() + .default("UTC"), + ) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_user_channel") + .from(User::Table, User::DmChannel) + .to(Channel::Table, Channel::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(Reminder::Table) + .if_not_exists() + .col( + ColumnDef::new(Reminder::Id) + .integer() + .not_null() + .auto_increment() + .primary_key(), + ) + .col(ColumnDef::new(Reminder::Uid).string().char_len(64).not_null()) + .col( + ColumnDef::new(Reminder::Name) + .string() + .char_len(24) + .default("Reminder") + .not_null(), + ) + .col(ColumnDef::new(Reminder::ChannelId).big_integer().not_null()) + .col(ColumnDef::new(Reminder::UtcTime).date_time().not_null()) + .col( + ColumnDef::new(Reminder::Timezone) + .custom(Timezone::Type) + .not_null() + .default("UTC"), + ) + .col(ColumnDef::new(Reminder::IntervalSeconds).integer()) + .col(ColumnDef::new(Reminder::IntervalMonths).integer()) + .col(ColumnDef::new(Reminder::Enabled).boolean().not_null().default(false)) + .col(ColumnDef::new(Reminder::Expires).date_time()) + .col(ColumnDef::new(Reminder::Username).string_len(32)) + .col(ColumnDef::new(Reminder::Avatar).string_len(512)) + .col(ColumnDef::new(Reminder::Content).string_len(2000)) + .col(ColumnDef::new(Reminder::Tts).boolean().not_null().default(false)) + .col(ColumnDef::new(Reminder::Attachment).binary_len(8 * 1024 * 1024)) + .col(ColumnDef::new(Reminder::AttachmentName).string_len(260)) + .col(ColumnDef::new(Reminder::EmbedTitle).string_len(256)) + .col(ColumnDef::new(Reminder::EmbedDescription).string_len(4096)) + .col(ColumnDef::new(Reminder::EmbedImageUrl).string_len(500)) + .col(ColumnDef::new(Reminder::EmbedThumbnailUrl).string_len(500)) + .col(ColumnDef::new(Reminder::EmbedFooter).string_len(2048)) + .col(ColumnDef::new(Reminder::EmbedFooterUrl).string_len(500)) + .col(ColumnDef::new(Reminder::EmbedAuthor).string_len(256)) + .col(ColumnDef::new(Reminder::EmbedAuthorUrl).string_len(500)) + .col(ColumnDef::new(Reminder::EmbedColor).integer()) + .col(ColumnDef::new(Reminder::EmbedFields).json()) + .col(ColumnDef::new(Reminder::SetAt).date_time().not_null().default("NOW()")) + .col(ColumnDef::new(Reminder::SetBy).big_integer().not_null()) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_reminder_channel") + .from(Reminder::Table, Reminder::ChannelId) + .to(Channel::Table, Channel::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_reminder_user") + .from(Reminder::Table, Reminder::SetBy) + .to(User::Table, User::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(ReminderTemplate::Table) + .if_not_exists() + .col( + ColumnDef::new(ReminderTemplate::Id) + .integer() + .not_null() + .auto_increment() + .primary_key(), + ) + .col(ColumnDef::new(ReminderTemplate::GuildId).big_integer().not_null()) + .col( + ColumnDef::new(ReminderTemplate::Name) + .string() + .char_len(24) + .default("Reminder") + .not_null(), + ) + .col(ColumnDef::new(ReminderTemplate::Username).string_len(32)) + .col(ColumnDef::new(ReminderTemplate::Avatar).string_len(512)) + .col(ColumnDef::new(ReminderTemplate::Content).string_len(2000)) + .col(ColumnDef::new(ReminderTemplate::Tts).boolean().not_null().default(false)) + .col(ColumnDef::new(ReminderTemplate::Attachment).binary_len(8 * 1024 * 1024)) + .col(ColumnDef::new(ReminderTemplate::AttachmentName).string_len(260)) + .col(ColumnDef::new(ReminderTemplate::EmbedTitle).string_len(256)) + .col(ColumnDef::new(ReminderTemplate::EmbedDescription).string_len(4096)) + .col(ColumnDef::new(ReminderTemplate::EmbedImageUrl).string_len(500)) + .col(ColumnDef::new(ReminderTemplate::EmbedThumbnailUrl).string_len(500)) + .col(ColumnDef::new(ReminderTemplate::EmbedFooter).string_len(2048)) + .col(ColumnDef::new(ReminderTemplate::EmbedFooterUrl).string_len(500)) + .col(ColumnDef::new(ReminderTemplate::EmbedAuthor).string_len(256)) + .col(ColumnDef::new(ReminderTemplate::EmbedAuthorUrl).string_len(500)) + .col(ColumnDef::new(ReminderTemplate::EmbedColor).integer()) + .col(ColumnDef::new(ReminderTemplate::EmbedFields).json()) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_reminder_template_guild") + .from(ReminderTemplate::Table, ReminderTemplate::GuildId) + .to(Guild::Table, Guild::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(Timer::Table) + .if_not_exists() + .col( + ColumnDef::new(Timer::Id) + .integer() + .not_null() + .auto_increment() + .primary_key(), + ) + .col(ColumnDef::new(Timer::StartTime).date_time().not_null().default("NOW()")) + .col(ColumnDef::new(Timer::Name).string_len(32).not_null().default("Timer")) + .col(ColumnDef::new(Timer::UserId).big_integer()) + .col(ColumnDef::new(Timer::GuildId).big_integer()) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_timer_user") + .from(Timer::Table, Timer::UserId) + .to(Guild::Table, Guild::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_timer_guild") + .from(Timer::Table, Timer::GuildId) + .to(Guild::Table, Guild::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(Todo::Table) + .if_not_exists() + .col( + ColumnDef::new(Todo::Id) + .integer() + .not_null() + .auto_increment() + .primary_key(), + ) + .col(ColumnDef::new(Todo::UserId).big_integer()) + .col(ColumnDef::new(Todo::GuildId).big_integer()) + .col(ColumnDef::new(Todo::ChannelId).big_integer()) + .col(ColumnDef::new(Todo::Value).string_len(2000).not_null()) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_todo_user") + .from(Todo::Table, Todo::UserId) + .to(User::Table, User::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_todo_guild") + .from(Todo::Table, Todo::GuildId) + .to(Guild::Table, Guild::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_todo_channel") + .from(Todo::Table, Todo::ChannelId) + .to(Channel::Table, Channel::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + manager + .create_table( + Table::create() + .table(CommandMacro::Table) + .if_not_exists() + .col( + ColumnDef::new(CommandMacro::Id) + .integer() + .not_null() + .auto_increment() + .primary_key(), + ) + .col(ColumnDef::new(CommandMacro::GuildId).big_integer().not_null()) + .col(ColumnDef::new(CommandMacro::Name).string_len(100).not_null()) + .col(ColumnDef::new(CommandMacro::Description).string_len(100)) + .col(ColumnDef::new(CommandMacro::Commands).json()) + .to_owned(), + ) + .await?; + + manager + .create_foreign_key( + ForeignKey::create() + .name("fk_command_macro_guild") + .from(CommandMacro::Table, CommandMacro::GuildId) + .to(Guild::Table, Guild::Id) + .on_delete(ForeignKeyAction::Cascade) + .to_owned(), + ) + .await?; + + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .drop_foreign_key( + ForeignKey::drop().table(Channel::Table).name("fk_channel_guild").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(User::Table).name("fk_user_channel").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(Reminder::Table).name("fk_reminder_channel").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(Reminder::Table).name("fk_reminder_user").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop() + .table(ReminderTemplate::Table) + .name("fk_reminder_template_guild") + .to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(Timer::Table).name("fk_timer_user").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(Timer::Table).name("fk_timer_guild").to_owned(), + ) + .await?; + manager + .drop_foreign_key(ForeignKey::drop().table(Todo::Table).name("fk_todo_user").to_owned()) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(Todo::Table).name("fk_todo_guild").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop().table(Todo::Table).name("fk_todo_channel").to_owned(), + ) + .await?; + manager + .drop_foreign_key( + ForeignKey::drop() + .table(CommandMacro::Table) + .name("fk_command_macro_guild") + .to_owned(), + ) + .await?; + + manager.drop_table(Table::drop().table(Guild::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(Channel::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(User::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(Reminder::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(ReminderTemplate::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(Timer::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(Todo::Table).to_owned()).await?; + manager.drop_table(Table::drop().table(CommandMacro::Table).to_owned()).await?; + + manager.drop_type(Type::drop().name(Timezone::Type).to_owned()).await?; + + Ok(()) + } +} diff --git a/models/migration/src/main.rs b/models/migration/src/main.rs new file mode 100644 index 0000000..c6b6e48 --- /dev/null +++ b/models/migration/src/main.rs @@ -0,0 +1,6 @@ +use sea_orm_migration::prelude::*; + +#[async_std::main] +async fn main() { + cli::run_cli(migration::Migrator).await; +} diff --git a/models/src/lib.rs b/models/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/models/src/lib.rs @@ -0,0 +1 @@ +