From b04bced37faa955b5a9dbb0e9f58f79e3cfeffb9 Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Sun, 31 Jul 2022 13:29:20 -0700 Subject: [PATCH] More project data (#406) * More project data * Array_agg fixes + cleanup * fix prepare * Add approval dates to search * Update migrations/20220725204351_more-project-data.sql Co-authored-by: wafflecoffee * Add category labels + display categories Co-authored-by: wafflecoffee --- Cargo.lock | 254 +- Cargo.toml | 9 +- .../20220725204351_more-project-data.sql | 37 + sqlx-data.json | 6181 +++++++++-------- src/database/models/categories.rs | 39 +- src/database/models/mod.rs | 14 +- src/database/models/notification_item.rs | 47 +- src/database/models/project_item.rs | 147 +- src/database/models/report_item.rs | 6 +- src/database/models/user_item.rs | 4 +- src/database/models/version_item.rs | 69 +- src/file_hosting/mock.rs | 4 +- src/file_hosting/s3_host.rs | 4 +- src/models/notifications.rs | 5 +- src/models/projects.rs | 23 +- src/models/reports.rs | 5 +- src/models/users.rs | 5 +- src/routes/auth.rs | 8 +- src/routes/maven.rs | 2 +- src/routes/project_creation.rs | 27 +- src/routes/projects.rs | 76 +- src/routes/reports.rs | 6 +- src/routes/tags.rs | 10 +- src/routes/v1/reports.rs | 9 +- src/routes/v1/versions.rs | 5 +- src/routes/version_creation.rs | 23 +- src/scheduler.rs | 21 +- src/search/indexing/local_import.rs | 33 +- src/search/indexing/mod.rs | 2 - src/search/mod.rs | 12 +- src/util/mod.rs | 1 - src/util/time_ser.rs | 42 - src/util/webhook.rs | 5 +- src/validate/fabric.rs | 7 +- src/validate/forge.rs | 17 +- src/validate/mod.rs | 6 +- src/validate/quilt.rs | 8 +- src/validate/resourcepack.rs | 17 +- 38 files changed, 3673 insertions(+), 3517 deletions(-) create mode 100644 migrations/20220725204351_more-project-data.sql delete mode 100644 src/util/time_ser.rs diff --git a/Cargo.lock b/Cargo.lock index 3fd3ac306..a83e19cae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -351,9 +351,9 @@ checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" [[package]] name = "atoi" -version = "0.4.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" +checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" dependencies = [ "num-traits", ] @@ -416,12 +416,6 @@ dependencies = [ "anyhow", ] -[[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" @@ -599,6 +593,20 @@ 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 = "cipher" version = "0.3.0" @@ -617,12 +625,6 @@ 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 = "constant_time_eq" version = "0.1.5" @@ -673,18 +675,18 @@ dependencies = [ [[package]] name = "crc" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" +checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "1.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" +checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" [[package]] name = "crc32fast" @@ -831,7 +833,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version", "syn", ] @@ -875,12 +877,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "dlv-list" version = "0.2.3" @@ -1130,7 +1126,7 @@ checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.10.0+wasi-snapshot-preview1", ] [[package]] @@ -1186,23 +1182,23 @@ name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" +dependencies = [ + "ahash 0.7.6", +] [[package]] name = "hashlink" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "d452c155cb93fecdfb02a73dd57b5d8e442c2063bd7aac72f1bc5e4263a43086" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.12.1", ] [[package]] @@ -1453,7 +1449,7 @@ dependencies = [ [[package]] name = "labrinth" -version = "2.4.4" +version = "2.5.0" dependencies = [ "actix", "actix-cors", @@ -1466,6 +1462,7 @@ dependencies = [ "bytes", "cached", "censor", + "chrono", "dashmap", "dotenv", "env_logger", @@ -1487,7 +1484,6 @@ dependencies = [ "sha2 0.9.9", "sqlx", "thiserror", - "time 0.2.27", "tokio", "tokio-stream", "url", @@ -1728,6 +1724,16 @@ dependencies = [ "minimal-lexical", ] +[[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" @@ -1993,12 +1999,6 @@ dependencies = [ "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.39" @@ -2195,37 +2195,36 @@ dependencies = [ "url", ] -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.9", + "semver", ] [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" dependencies = [ - "base64", "log", "ring", "sct", "webpki", ] +[[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" @@ -2256,9 +2255,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "untrusted", @@ -2287,27 +2286,12 @@ dependencies = [ "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" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" -[[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" @@ -2508,9 +2492,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.5.13" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b" +checksum = "1f82cbe94f41641d6c410ded25bbf5097c240cefdf8e3b06d04198d0a96af6a4" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2518,9 +2502,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.5.13" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5" +checksum = "6b69bf218860335ddda60d6ce85ee39f6cf6e5630e300e19757d1de15886a093" dependencies = [ "ahash 0.7.6", "atoi", @@ -2528,6 +2512,7 @@ dependencies = [ "bitflags", "byteorder", "bytes", + "chrono", "crc", "crossbeam-queue", "dirs", @@ -2552,6 +2537,7 @@ dependencies = [ "percent-encoding", "rand", "rustls", + "rustls-pemfile", "serde", "serde_json", "sha-1", @@ -2561,19 +2547,17 @@ dependencies = [ "sqlx-rt", "stringprep", "thiserror", - "time 0.2.27", "tokio-stream", "url", - "webpki", "webpki-roots", "whoami", ] [[package]] name = "sqlx-macros" -version = "0.5.13" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1" +checksum = "f40c63177cf23d356b159b60acd27c54af7423f1736988502e36bae9a712118f" dependencies = [ "dotenv", "either", @@ -2593,9 +2577,9 @@ dependencies = [ [[package]] name = "sqlx-rt" -version = "0.5.13" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae" +checksum = "874e93a365a598dc3dadb197565952cb143ae4aa716f7bcc933a8d836f6bf89f" dependencies = [ "actix-rt", "once_cell", @@ -2603,70 +2587,12 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "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 0.6.1", - "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" @@ -2745,17 +2671,12 @@ dependencies = [ [[package]] name = "time" -version = "0.2.27" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ - "const_fn", "libc", - "serde", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] @@ -2769,17 +2690,7 @@ dependencies = [ "libc", "num_threads", "serde", - "time-macros 0.2.4", -] - -[[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", + "time-macros", ] [[package]] @@ -2788,19 +2699,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" -[[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" @@ -2859,9 +2757,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", "tokio", @@ -3114,9 +3012,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -3202,9 +3100,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ "ring", "untrusted", @@ -3212,9 +3110,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" dependencies = [ "webpki", ] diff --git a/Cargo.toml b/Cargo.toml index 28f345cae..8abd6103a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,7 @@ [package] name = "labrinth" -version = "2.4.4" -#Team members, please add your emails and usernames -authors = ["geometrically ", "Redblueflame ", "Aeledfyr ", "Charalampos Fanoulis ", "AppleTheGolden "] +version = "2.5.0" +authors = ["geometrically "] edition = "2018" license = "AGPL-3.0" @@ -31,7 +30,7 @@ xml-rs = "0.8.4" serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } serde_with = "1.12.0" -time = { version = "0.2.27", features = ["serde"] } +chrono = { version = "0.4.19", features = ["serde"]} rand = "0.8.5" base64 = "0.13.0" sha1 = { version = "0.6.1", features = ["std"] } @@ -57,7 +56,7 @@ futures-timer = "3.0.2" rust-s3 = "0.30.0" async-trait = "0.1.53" -sqlx = { version = "0.5.11", features = ["runtime-actix-rustls", "postgres", "time", "offline", "macros", "migrate"] } +sqlx = { version = "0.6.0", features = ["runtime-actix-rustls", "postgres", "chrono", "offline", "macros", "migrate"] } bytes = "1.1.0" diff --git a/migrations/20220725204351_more-project-data.sql b/migrations/20220725204351_more-project-data.sql new file mode 100644 index 000000000..e18ff7ca5 --- /dev/null +++ b/migrations/20220725204351_more-project-data.sql @@ -0,0 +1,37 @@ +-- Add migration script here +ALTER TABLE mods_categories + ADD COLUMN is_additional BOOLEAN NOT NULL DEFAULT FALSE; + +ALTER TABLE mods + ADD COLUMN approved timestamptz NULL; + +ALTER TABLE categories + ADD COLUMN header varchar(256) NOT NULL DEFAULT 'Categories'; + +UPDATE mods + SET approved = published + WHERE status = 1 OR status = 4; + +CREATE INDEX mods_slug + ON mods (slug); + +CREATE INDEX versions_mod_id + ON versions (mod_id); + +CREATE INDEX files_version_id + ON files (version_id); + +CREATE INDEX dependencies_dependent_id + ON dependencies (dependent_id); + +CREATE INDEX mods_gallery_mod_id + ON mods_gallery(mod_id); + +CREATE INDEX game_versions_versions_joining_version_id + ON game_versions_versions(joining_version_id); + +CREATE INDEX loaders_versions_version_id + ON loaders_versions(version_id); + +CREATE INDEX notifications_user_id + ON notifications(user_id); \ No newline at end of file diff --git a/sqlx-data.json b/sqlx-data.json index 6ab81bbb9..ace49d1d5 100644 --- a/sqlx-data.json +++ b/sqlx-data.json @@ -1,65 +1,77 @@ { "db": "PostgreSQL", - "017c9fd0c8103c590489453a25b3317e6790a21f388bcf7ec8c93cd26255f368": { - "query": "\n SELECT id, team_id, role, permissions, accepted\n FROM team_members\n WHERE (user_id = $1 AND accepted = TRUE)\n ", + "006e439742f15d3de8c3c3fbacbc199a25c0f01d736869cdccbdec725e2971e9": { "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "team_id", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "role", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "permissions", - "type_info": "Int8" - }, - { - "ordinal": 4, - "name": "accepted", - "type_info": "Bool" - } - ], + "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, + } + }, + "query": "\n DELETE FROM mods_categories\n WHERE joining_mod_id = $1 AND is_additional = FALSE\n " + }, + "017c9fd0c8103c590489453a25b3317e6790a21f388bcf7ec8c93cd26255f368": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "team_id", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "role", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "permissions", + "ordinal": 3, + "type_info": "Int8" + }, + { + "name": "accepted", + "ordinal": 4, + "type_info": "Bool" + } + ], "nullable": [ false, false, false, false, false - ] - } - }, - "0267d1ea5387d4acfc132aeb4776004a1ebb048e7789e686bfaba3357d392f62": { - "query": "\n DELETE FROM mods_donations\n WHERE joining_mod_id = $1\n ", - "describe": { - "columns": [], + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n SELECT id, team_id, role, permissions, accepted\n FROM team_members\n WHERE (user_id = $1 AND accepted = TRUE)\n " }, - "03209c5bda2d704e688439919a7b3903db6ad7caebf7ddafb3ea52d312d47bfb": { - "query": "\n INSERT INTO users (\n id, github_id, username, name, email,\n avatar_url, bio, created\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7, $8\n )\n ", + "0267d1ea5387d4acfc132aeb4776004a1ebb048e7789e686bfaba3357d392f62": { "describe": { "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n DELETE FROM mods_donations\n WHERE joining_mod_id = $1\n " + }, + "03209c5bda2d704e688439919a7b3903db6ad7caebf7ddafb3ea52d312d47bfb": { + "describe": { + "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -71,214 +83,227 @@ "Varchar", "Timestamptz" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO users (\n id, github_id, username, name, email,\n avatar_url, bio, created\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7, $8\n )\n " }, "041f499f542ddab1b81bd445d6cabe225b1b2ad3ec7bbc1f755346c016ae06e6": { - "query": "\n DELETE FROM reports\n WHERE user_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM reports\n WHERE user_id = $1\n " }, "04345d9c23430267f755b1420520df91bd403524fd60ba1a94e3a239ea70cae7": { - "query": "\n UPDATE mods\n SET source_url = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET source_url = $1\n WHERE (id = $2)\n " }, "04dcb2565608e296502694efc0c59bc77c41175ef65c830f2fef745773f18c86": { - "query": "\n UPDATE mods\n SET moderation_message_body = NULL\n WHERE (id = $1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET moderation_message_body = NULL\n WHERE (id = $1)\n " }, - "06a92b638c77276f36185788748191e7731a2cce874ecca4af913d0d0412d223": { - "query": "\n UPDATE versions\n SET downloads = $1\n WHERE (id = $2)\n ", + "05baeb26d9856218e5c6f8856a96788b2a7ac3536ff9412a50552cef1d561a1e": { "describe": { "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4" + ] + } + }, + "query": "\n INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional)\n VALUES ($1, $2, FALSE)\n " + }, + "06a92b638c77276f36185788748191e7731a2cce874ecca4af913d0d0412d223": { + "describe": { + "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE versions\n SET downloads = $1\n WHERE (id = $2)\n " }, "06c2d67bcbc95baa4b7e5865ec9adec7f068c1dfd3f859c29465b8d8a40343e0": { - "query": "\n SELECT m.id FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.accepted = TRUE\n WHERE tm.user_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT m.id FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.accepted = TRUE\n WHERE tm.user_id = $1\n " }, "07ebc9dc82cd012cd4f5880b1eb3d82602c195a3e3ddd557103ee037aa6dad1c": { - "query": "\n INSERT INTO mods_donations (joining_mod_id, joining_platform_id, url)\n VALUES ($1, $2, $3)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int4", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO mods_donations (joining_mod_id, joining_platform_id, url)\n VALUES ($1, $2, $3)\n " }, "091f325c84d0cf6dfe6933567c58fea815912ba613ffb3536466770d71ea613e": { - "query": "\n SELECT f.version_id version_id\n FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v on f.version_id = v.id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = $1 AND s.status != $3\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "version_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Bytea", "Text", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT f.version_id version_id\n FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v on f.version_id = v.id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = $1 AND s.status != $3\n " }, "0a1a470c12b84c7e171f0f51e8e541e9abe8bbee17fc441a5054e1dfd5607c05": { - "query": "\n UPDATE versions\n SET name = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE versions\n SET name = $1\n WHERE (id = $2)\n " }, "0ca11a32b2860e4f5c3d20892a5be3cb419e084f42ba0f98e09b9995027fcc4e": { - "query": "\n SELECT id FROM statuses\n WHERE status = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM statuses\n WHERE status = $1\n " }, "0dbd0fa9a25416716a047184944d243ed5cb55808c6f300d7335c887f02a7f6e": { - "query": "\n INSERT INTO report_types (name)\n VALUES ($1)\n ON CONFLICT (name) DO NOTHING\n RETURNING id\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], - "parameters": { - "Left": [ - "Varchar" - ] - }, "nullable": [ false - ] - } + ], + "parameters": { + "Left": [ + "Varchar" + ] + } + }, + "query": "\n INSERT INTO report_types (name)\n VALUES ($1)\n ON CONFLICT (name) DO NOTHING\n RETURNING id\n " }, "0f29bb5ba767ebd0669c860994e48e3cb2674f0d53f6c4ab85c79d46b04cbb40": { - "query": "\n SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)\n " }, "0fb1cca8a2a37107104244953371fe2f8a5e6edd57f4b325c5842c6571eb16b4": { - "query": "\n SELECT EXISTS(SELECT 1 FROM mod_follows mf WHERE mf.follower_id = $1 AND mf.mod_id = $2)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8", "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM mod_follows mf WHERE mf.follower_id = $1 AND mf.mod_id = $2)\n " }, "114df19aa81498b77022bd7347dd4449c7cc48efdab19003bde62c2f2f837d3c": { - "query": "\n INSERT INTO notifications (\n id, user_id, title, text, link, type\n )\n VALUES (\n $1, $2, $3, $4, $5, $6\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -288,157 +313,219 @@ "Varchar", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO notifications (\n id, user_id, title, text, link, type\n )\n VALUES (\n $1, $2, $3, $4, $5, $6\n )\n " }, "1209ffc1ffbea89f7060573275dc7325ac4d7b4885b6c1d1ec92998e6012e455": { - "query": "\n UPDATE mods_gallery\n SET description = $2\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods_gallery\n SET description = $2\n WHERE id = $1\n " }, "153100dc632392c4d446cc768235d071bac26a0818a4a72d203d8e549f969eea": { - "query": "SELECT id FROM versions WHERE mod_id = $1 AND version_number = $2", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "SELECT id FROM versions WHERE mod_id = $1 AND version_number = $2" }, "15b8ea323c2f6d03c2e385d9c46d7f13460764f2f106fd638226c42ae0217f75": { - "query": "\n DELETE FROM notifications\n WHERE user_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM notifications\n WHERE user_id = $1\n " }, "16049957962ded08751d5a4ddce2ffac17ecd486f61210c51a952508425d83e6": { - "query": "\n UPDATE versions\n SET changelog = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE versions\n SET changelog = $1\n WHERE (id = $2)\n " }, "164e5168aabe47d64f99ea851392c9d8479022cff360a610f185c342a24e88d8": { - "query": "\n SELECT mod_id FROM versions WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "mod_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT mod_id FROM versions WHERE id = $1\n " }, "16b3ac53ef5e94f51ab39484add21e2f76d49015917dc877560607a31f5537e9": { - "query": "\n UPDATE users\n SET email = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE users\n SET email = $1\n WHERE (id = $2)\n " }, - "191a613898e0bedc6f7bc15e6a2b986f1c75012780db8d96caba476c81692520": { - "query": "\n SELECT u.id, u.github_id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role FROM users u\n WHERE u.id = ANY($1)\n ", + "16fb3fafaed2fe122b7c5bb5d987b16dc12008441c8e07f76c9515639c801f0d": { "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { + "name": "user_id", "ordinal": 1, - "name": "github_id", "type_info": "Int8" }, { + "name": "title", "ordinal": 2, - "name": "name", "type_info": "Varchar" }, { + "name": "text", "ordinal": 3, - "name": "email", "type_info": "Varchar" }, { + "name": "link", "ordinal": 4, - "name": "avatar_url", "type_info": "Varchar" }, { - "ordinal": 5, - "name": "username", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "bio", - "type_info": "Varchar" - }, - { - "ordinal": 7, "name": "created", + "ordinal": 5, "type_info": "Timestamptz" }, { - "ordinal": 8, - "name": "role", + "name": "read", + "ordinal": 6, + "type_info": "Bool" + }, + { + "name": "notification_type", + "ordinal": 7, "type_info": "Varchar" + }, + { + "name": "actions", + "ordinal": 8, + "type_info": "TextArray" } ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + true, + null + ], "parameters": { "Left": [ "Int8Array" ] - }, + } + }, + "query": "\n SELECT n.id, n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type,\n ARRAY_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method) filter (where na.id is not null) actions\n FROM notifications n\n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id\n WHERE n.id = ANY($1)\n GROUP BY n.id, n.user_id\n ORDER BY n.created DESC;\n " + }, + "191a613898e0bedc6f7bc15e6a2b986f1c75012780db8d96caba476c81692520": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "github_id", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "name", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "email", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "avatar_url", + "ordinal": 4, + "type_info": "Varchar" + }, + { + "name": "username", + "ordinal": 5, + "type_info": "Varchar" + }, + { + "name": "bio", + "ordinal": 6, + "type_info": "Varchar" + }, + { + "name": "created", + "ordinal": 7, + "type_info": "Timestamptz" + }, + { + "name": "role", + "ordinal": 8, + "type_info": "Varchar" + } + ], "nullable": [ false, true, @@ -449,361 +536,390 @@ true, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + } + }, + "query": "\n SELECT u.id, u.github_id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role FROM users u\n WHERE u.id = ANY($1)\n " + }, + "19422e88b1b13318d75e8eb2ba142a562c550358b3136eef9ef73b5a216bbcdb": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Varchar", + "Int4", + "Varchar", + "Varchar" + ] + } + }, + "query": "\n INSERT INTO categories (category, project_type, icon, header)\n VALUES ($1, $2, $3, $4)\n RETURNING id\n " }, "19dc22c4d6d14222f8e8bace74c2961761c53b7375460ade15af921754d5d7da": { - "query": "\n UPDATE mods\n SET license = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET license = $1\n WHERE (id = $2)\n " }, "1ab781d26c93aa74bf90b78b74b99e50004d25d42d56b734e5e83f2333d0c0d2": { - "query": "\n UPDATE users\n SET avatar_url = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE users\n SET avatar_url = $1\n WHERE (id = $2)\n " }, "1c7b0eb4341af5a7942e52f632cf582561f10b4b6a41a082fb8a60f04ac17c6e": { - "query": "SELECT EXISTS(SELECT 1 FROM states WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM states WHERE id=$1)" }, "1ce90594000fa30876bf277d9ebe2901acf9afaf256dd4488166d55fdd950347": { - "query": "\n DELETE FROM donation_platforms\n WHERE short = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM donation_platforms\n WHERE short = $1\n " }, "1d3b582e6765e1ae578039e44b5dc9be6f3f845c96ffd43b7ba83f9eab816f93": { - "query": "\n SELECT name FROM report_types\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT name FROM report_types\n WHERE id = $1\n " }, "1d6f3e926fc4a27c5af172f672b7f825f9f5fe2d538b06337ef182ab1a553398": { - "query": "\n SELECT name FROM project_types pt\n INNER JOIN mods ON mods.project_type = pt.id\n WHERE mods.id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT name FROM project_types pt\n INNER JOIN mods ON mods.project_type = pt.id\n WHERE mods.id = $1\n " }, "1db6be78a74ff04c52ee105e0df30acf5bbf18f1de328980bb7f3da7f5f6569e": { - "query": "\n SELECT id FROM side_types\n WHERE name = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM side_types\n WHERE name = $1\n " }, "1ffce9b2d5c9fa6c8b9abce4bad9f9419c44ad6367b7463b979c91b9b5b4fea1": { - "query": "SELECT EXISTS(SELECT 1 FROM versions WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM versions WHERE id=$1)" }, "20c6f94eae9260fc3f91de3e4a42c544e0b5c01227854956d04db7641c03c1b8": { - "query": "\n SELECT d.id id\n FROM dependencies d\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = d.dependent_id AND gvv.game_version_id = ANY($2)\n INNER JOIN loaders_versions lv ON lv.version_id = d.dependent_id AND lv.loader_id = ANY($3)\n WHERE d.mod_dependency_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8", "Int4Array", "Int4Array" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT d.id id\n FROM dependencies d\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = d.dependent_id AND gvv.game_version_id = ANY($2)\n INNER JOIN loaders_versions lv ON lv.version_id = d.dependent_id AND lv.loader_id = ANY($3)\n WHERE d.mod_dependency_id = $1\n " }, "2162043897db26d0b55a0652c1a6db66c555f1d148ce69bd0bd0d2122de1bd6a": { - "query": "\n DELETE FROM mods_gallery\n WHERE mod_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM mods_gallery\n WHERE mod_id = $1\n " }, "2278a7db5eb0474576fa9c86ba97bd6bf13864b3f9ce55ed2ab0cb94edbadaf5": { - "query": "\n SELECT url, expires FROM states\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "url", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "expires", + "ordinal": 1, "type_info": "Timestamptz" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false, - false - ] - } + } + }, + "query": "\n SELECT url, expires FROM states\n WHERE id = $1\n " }, "232d7d0319c20dd5fff29331b067d6c6373bcff761a77958a2bb5f59068a83a5": { - "query": "\n UPDATE team_members\n SET permissions = $1\n WHERE (team_id = $2 AND user_id = $3)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE team_members\n SET permissions = $1\n WHERE (team_id = $2 AND user_id = $3)\n " }, "24e5daad907eec54505274f93952d5c20f4bbdd3f771eb0a2fdfa6324768df39": { - "query": "\n SELECT short, name FROM licenses\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "short", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "name", + "ordinal": 1, "type_info": "Varchar" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [ - false, - false - ] - } + } + }, + "query": "\n SELECT short, name FROM licenses\n WHERE id = $1\n " }, "25131559cb73a088000ab6379a769233440ade6c7511542da410065190d203fc": { - "query": "\n SELECT id FROM loaders\n WHERE loader = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM loaders\n WHERE loader = $1\n " }, "27a35fca63dfc3801f95958604f0ac27afd81800e2dc981382d6f923c4415d32": { - "query": "\n DELETE FROM notifications_actions\n WHERE notification_id = ANY($1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8Array" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM notifications_actions\n WHERE notification_id = ANY($1)\n " }, "292da3eec2cc7d7eb635fa123be1b1387e9e91466f007e10101053fdb9874e3f": { - "query": "\n SELECT f.url url, f.id id, f.version_id version_id, v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = $1 AND s.status != $3\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "url", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "version_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "project_id", + "ordinal": 3, "type_info": "Int8" } ], + "nullable": [ + false, + false, + false, + false + ], "parameters": { "Left": [ "Bytea", "Text", "Text" ] - }, - "nullable": [ - false, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT f.url url, f.id id, f.version_id version_id, v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = $1 AND s.status != $3\n " }, "29e657d26f0fb24a766f5b5eb6a94d01d1616884d8ca10e91536e974d5b585a6": { - "query": "\n INSERT INTO loaders_versions (loader_id, version_id)\n VALUES ($1, $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO loaders_versions (loader_id, version_id)\n VALUES ($1, $2)\n " }, "2abecb467a9ad3b792babf20e09601c011fc2622e101e98054baeaacaa16795a": { - "query": "\n DELETE FROM licenses\n WHERE short = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM licenses\n WHERE short = $1\n " }, "2b8dafe9c3df9fd25235a13868e8e7607decfbe96a413cc576919a1fb510f269": { - "query": "\n UPDATE mods\n SET discord_url = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET discord_url = $1\n WHERE (id = $2)\n " }, "2d2e5b06be5125226ed9e4d7b7b5f99043db73537f2199f2146bdcd56091ae75": { - "query": "\n INSERT INTO team_members (id, team_id, user_id, role, permissions, accepted)\n VALUES ($1, $2, $3, $4, $5, $6)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -813,958 +929,1057 @@ "Int8", "Bool" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO team_members (id, team_id, user_id, role, permissions, accepted)\n VALUES ($1, $2, $3, $4, $5, $6)\n " }, - "307d73f16ac9595d2cd8bd684b7d0441037498a5790ca280881e71083a37ade8": { - "query": "\n SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,\n m.icon_url icon_url, m.published published,\n m.updated updated,\n m.team_id team_id, m.license license, m.slug slug,\n s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, pt.name project_type_name, u.username username,\n STRING_AGG(DISTINCT c.category, ',') categories, STRING_AGG(DISTINCT lo.loader, ',') loaders, STRING_AGG(DISTINCT gv.version, ',') versions,\n STRING_AGG(DISTINCT mg.image_url, ',') gallery\n FROM mods m\n LEFT OUTER JOIN mods_categories mc ON joining_mod_id = m.id\n LEFT OUTER JOIN categories c ON mc.joining_category_id = c.id\n LEFT OUTER JOIN versions v ON v.mod_id = m.id\n LEFT OUTER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id\n LEFT OUTER JOIN game_versions gv ON gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv ON lv.version_id = v.id\n LEFT OUTER JOIN loaders lo ON lo.id = lv.loader_id\n LEFT OUTER JOIN mods_gallery mg ON mg.mod_id = m.id\n INNER JOIN statuses s ON s.id = m.status\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN licenses l ON m.license = l.id\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.role = $3 AND tm.accepted = TRUE\n INNER JOIN users u ON tm.user_id = u.id\n WHERE s.status = $1 OR s.status = $2\n GROUP BY m.id, s.id, cs.id, ss.id, l.id, pt.id, u.id;\n ", + "33a965c7dc615d3b701c05299889357db8dd36d378850625d2602ba471af4885": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int4", + "Int8" + ] + } + }, + "query": "\n UPDATE mods\n SET downloads = downloads + $1\n WHERE (id = $2)\n " + }, + "33fc96ac71cfa382991cfb153e89da1e9f43ebf5367c28b30c336b758222307b": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n DELETE FROM loaders_versions\n WHERE loaders_versions.version_id = $1\n " + }, + "371048e45dd74c855b84cdb8a6a565ccbef5ad166ec9511ab20621c336446da6": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n UPDATE mods\n SET follows = follows - 1\n WHERE id = $1\n " + }, + "37f7baa7659d84d27972bb9f0f629e70661035a09f1b47bb55426902223d26f9": { "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "project_type", + "ordinal": 1, "type_info": "Int4" }, { - "ordinal": 2, "name": "title", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "description", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "downloads", + "ordinal": 4, "type_info": "Int4" }, { - "ordinal": 5, "name": "follows", + "ordinal": 5, "type_info": "Int4" }, { - "ordinal": 6, "name": "icon_url", + "ordinal": 6, "type_info": "Varchar" }, { - "ordinal": 7, "name": "published", + "ordinal": 7, "type_info": "Timestamptz" }, { + "name": "approved", "ordinal": 8, - "name": "updated", "type_info": "Timestamptz" }, { + "name": "updated", "ordinal": 9, + "type_info": "Timestamptz" + }, + { "name": "team_id", + "ordinal": 10, "type_info": "Int8" }, { - "ordinal": 10, "name": "license", + "ordinal": 11, "type_info": "Int4" }, { - "ordinal": 11, "name": "slug", - "type_info": "Varchar" - }, - { "ordinal": 12, + "type_info": "Varchar" + }, + { "name": "status_name", - "type_info": "Varchar" - }, - { "ordinal": 13, + "type_info": "Varchar" + }, + { "name": "client_side_type", - "type_info": "Varchar" - }, - { "ordinal": 14, + "type_info": "Varchar" + }, + { "name": "server_side_type", - "type_info": "Varchar" - }, - { "ordinal": 15, + "type_info": "Varchar" + }, + { "name": "short", - "type_info": "Varchar" - }, - { "ordinal": 16, + "type_info": "Varchar" + }, + { "name": "project_type_name", - "type_info": "Varchar" - }, - { "ordinal": 17, - "name": "username", "type_info": "Varchar" }, { + "name": "username", "ordinal": 18, + "type_info": "Varchar" + }, + { "name": "categories", - "type_info": "Text" - }, - { "ordinal": 19, - "name": "loaders", - "type_info": "Text" + "type_info": "VarcharArray" }, { + "name": "primary_categories", "ordinal": 20, - "name": "versions", - "type_info": "Text" + "type_info": "VarcharArray" }, { + "name": "loaders", "ordinal": 21, + "type_info": "VarcharArray" + }, + { + "name": "versions", + "ordinal": 22, + "type_info": "VarcharArray" + }, + { "name": "gallery", - "type_info": "Text" + "ordinal": 23, + "type_info": "VarcharArray" } ], + "nullable": [ + false, + false, + false, + false, + false, + false, + true, + false, + true, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + null, + null, + null, + null, + null + ], "parameters": { "Left": [ "Text", "Text", "Text" ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - null, - null, - null, - null - ] - } - }, - "33a965c7dc615d3b701c05299889357db8dd36d378850625d2602ba471af4885": { - "query": "\n UPDATE mods\n SET downloads = downloads + $1\n WHERE (id = $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Int8" - ] - }, - "nullable": [] - } - }, - "33fc96ac71cfa382991cfb153e89da1e9f43ebf5367c28b30c336b758222307b": { - "query": "\n DELETE FROM loaders_versions\n WHERE loaders_versions.version_id = $1\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - } - }, - "35b728453ade9cd9c535411fff194105c05726cea29446c3532aec9bfa4ffd2d": { - "query": "\n SELECT n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type,\n STRING_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method, ' ~~~~ ') actions\n FROM notifications n\n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id\n WHERE n.id = $1\n GROUP BY n.id, n.user_id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "user_id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "text", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "link", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "created", - "type_info": "Timestamptz" - }, - { - "ordinal": 5, - "name": "read", - "type_info": "Bool" - }, - { - "ordinal": 6, - "name": "notification_type", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "actions", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - true, - null - ] - } - }, - "371048e45dd74c855b84cdb8a6a565ccbef5ad166ec9511ab20621c336446da6": { - "query": "\n UPDATE mods\n SET follows = follows - 1\n WHERE id = $1\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - } - }, - "375d3e7221ca352efc3bec374b9924c864c1ea5808e99ee6b89e4dcb0d39ba7a": { - "query": "\n SELECT n.id, n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type,\n STRING_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method, ' ~~~~ ') actions\n FROM notifications n\n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id\n WHERE n.id = ANY($1)\n GROUP BY n.id, n.user_id\n ORDER BY n.created DESC;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "user_id", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "text", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "link", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "created", - "type_info": "Timestamptz" - }, - { - "ordinal": 6, - "name": "read", - "type_info": "Bool" - }, - { - "ordinal": 7, - "name": "notification_type", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "actions", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - true, - null - ] - } + } + }, + "query": "\n SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,\n m.icon_url icon_url, m.published published, m.approved approved, m.updated updated,\n m.team_id team_id, m.license license, m.slug slug,\n s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, pt.name project_type_name, u.username username,\n ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories, ARRAY_AGG(DISTINCT cp.category) filter (where cp.category is not null) primary_categories, ARRAY_AGG(DISTINCT lo.loader) filter (where lo.loader is not null) loaders, ARRAY_AGG(DISTINCT gv.version) filter (where gv.version is not null) versions,\n ARRAY_AGG(DISTINCT mg.image_url) filter (where mg.image_url is not null) gallery\n FROM mods m\n LEFT OUTER JOIN mods_categories mc ON joining_mod_id = m.id\n LEFT OUTER JOIN categories c ON mc.joining_category_id = c.id\n LEFT OUTER JOIN categories cp ON mc.joining_category_id = c.id AND mc.is_additional = FALSE\n LEFT OUTER JOIN versions v ON v.mod_id = m.id\n LEFT OUTER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id\n LEFT OUTER JOIN game_versions gv ON gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv ON lv.version_id = v.id\n LEFT OUTER JOIN loaders lo ON lo.id = lv.loader_id\n LEFT OUTER JOIN mods_gallery mg ON mg.mod_id = m.id\n INNER JOIN statuses s ON s.id = m.status\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN licenses l ON m.license = l.id\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.role = $3 AND tm.accepted = TRUE\n INNER JOIN users u ON tm.user_id = u.id\n WHERE s.status = $1 OR s.status = $2\n GROUP BY m.id, s.id, cs.id, ss.id, l.id, pt.id, u.id;\n " }, "3831c1b321e47690f1f54597506a0d43362eda9540c56acb19c06532bba50b01": { - "query": "\n SELECT id, user_id, role, permissions, accepted\n FROM team_members\n WHERE team_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "user_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "role", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "permissions", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "accepted", + "ordinal": 4, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, false, false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT id, user_id, role, permissions, accepted\n FROM team_members\n WHERE team_id = $1\n " + }, + "391f734b23be4346960ea82bc3d0cefe7de025fe0e400634e3dfc136486e7fc9": { + "describe": { + "columns": [ + { + "name": "project_type", + "ordinal": 0, + "type_info": "Int4" + }, + { + "name": "title", + "ordinal": 1, + "type_info": "Varchar" + }, + { + "name": "description", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "downloads", + "ordinal": 3, + "type_info": "Int4" + }, + { + "name": "follows", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "icon_url", + "ordinal": 5, + "type_info": "Varchar" + }, + { + "name": "body", + "ordinal": 6, + "type_info": "Varchar" + }, + { + "name": "body_url", + "ordinal": 7, + "type_info": "Varchar" + }, + { + "name": "published", + "ordinal": 8, + "type_info": "Timestamptz" + }, + { + "name": "updated", + "ordinal": 9, + "type_info": "Timestamptz" + }, + { + "name": "approved", + "ordinal": 10, + "type_info": "Timestamptz" + }, + { + "name": "status", + "ordinal": 11, + "type_info": "Int4" + }, + { + "name": "issues_url", + "ordinal": 12, + "type_info": "Varchar" + }, + { + "name": "source_url", + "ordinal": 13, + "type_info": "Varchar" + }, + { + "name": "wiki_url", + "ordinal": 14, + "type_info": "Varchar" + }, + { + "name": "discord_url", + "ordinal": 15, + "type_info": "Varchar" + }, + { + "name": "license_url", + "ordinal": 16, + "type_info": "Varchar" + }, + { + "name": "team_id", + "ordinal": 17, + "type_info": "Int8" + }, + { + "name": "client_side", + "ordinal": 18, + "type_info": "Int4" + }, + { + "name": "server_side", + "ordinal": 19, + "type_info": "Int4" + }, + { + "name": "license", + "ordinal": 20, + "type_info": "Int4" + }, + { + "name": "slug", + "ordinal": 21, + "type_info": "Varchar" + }, + { + "name": "moderation_message", + "ordinal": 22, + "type_info": "Varchar" + }, + { + "name": "moderation_message_body", + "ordinal": 23, + "type_info": "Varchar" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + true, + false, + true, + false, + false, + true, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT project_type, title, description, downloads, follows,\n icon_url, body, body_url, published,\n updated, approved, status,\n issues_url, source_url, wiki_url, discord_url, license_url,\n team_id, client_side, server_side, license, slug,\n moderation_message, moderation_message_body\n FROM mods\n WHERE id = $1\n " }, "398ac436f5fe2f6a66544204b9ff01ae1ea1204edf03ffc16de657a861cfe0ba": { - "query": "\n DELETE FROM categories\n WHERE category = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM categories\n WHERE category = $1\n " }, "3af747b5543a5a9b10dcce0a1eb9c2a1926dd5a507fe0d8b7f52d8ccc7fcd0af": { - "query": "\n UPDATE mods_gallery\n SET featured = $2\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Bool" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods_gallery\n SET featured = $2\n WHERE id = $1\n " }, "3b1fba1ce47e94c0301c8a234bc7609e3c62fc02acd1485283c0f824cff2d69b": { - "query": "\n SELECT h.hash hash, h.algorithm algorithm, f.version_id version_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = ANY($1::bytea[]) AND s.status != $3\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "hash", + "ordinal": 0, "type_info": "Bytea" }, { - "ordinal": 1, "name": "algorithm", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "version_id", + "ordinal": 2, "type_info": "Int8" } ], + "nullable": [ + false, + false, + false + ], "parameters": { "Left": [ "ByteaArray", "Text", "Text" ] - }, - "nullable": [ - false, - false, - false - ] - } + } + }, + "query": "\n SELECT h.hash hash, h.algorithm algorithm, f.version_id version_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = ANY($1::bytea[]) AND s.status != $3\n " }, "3bdcbfa5abe43cc9b4f996f147277a7f6921cca00f82cad0ef5d85032c761a36": { - "query": "\n DELETE FROM mod_follows\n WHERE follower_id = $1 AND mod_id = $2\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM mod_follows\n WHERE follower_id = $1 AND mod_id = $2\n " }, "3c061c1888cb14655288cdbb2dad22f6cb51d6be3736e8d8206f918a9a64aec7": { - "query": "\n UPDATE mods_gallery\n SET title = $2\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods_gallery\n SET title = $2\n WHERE id = $1\n " }, "3d384766d179f804c17e03d1917da65cc6043f88971ddc3fd23ba3be00717dfc": { - "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major FROM game_versions gv\n ORDER BY created DESC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "version_", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "type_", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "created", + "ordinal": 3, "type_info": "Timestamptz" }, { - "ordinal": 4, "name": "major", + "ordinal": 4, "type_info": "Bool" } ], - "parameters": { - "Left": [] - }, "nullable": [ false, false, false, false, false - ] - } + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major FROM game_versions gv\n ORDER BY created DESC\n " }, "3d700aaeb0d5129ac8c297ee0542757435a50a35ec94582d9d6ce67aa5302291": { - "query": "\n UPDATE mods\n SET title = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET title = $1\n WHERE (id = $2)\n " }, "3f2f05653552ce8c1be95ce0a922ab41f52f40f8ff6c91c6621481102c8f35e3": { - "query": "\n INSERT INTO game_versions_versions (game_version_id, joining_version_id)\n VALUES ($1, $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO game_versions_versions (game_version_id, joining_version_id)\n VALUES ($1, $2)\n " }, "4298552497a48adb9ace61c8dcf989c4d35866866b61c0cc4d45909b1d31c660": { - "query": "\n SELECT EXISTS(SELECT 1 FROM hashes h\n WHERE h.algorithm = $2 AND h.hash = $1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Bytea", "Text" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM hashes h\n WHERE h.algorithm = $2 AND h.hash = $1)\n " }, "436dbf448697436ec90c30f44b27c92ec626601e7a7a9edb4d11bd916741b60f": { - "query": "\n UPDATE mods\n SET icon_url = NULL\n WHERE (id = $1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET icon_url = NULL\n WHERE (id = $1)\n " }, "447350097928db863d47d756354cd52668f52f7156dd7f3673a826f7b9aca2fd": { - "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major major FROM game_versions gv\n WHERE major = $1 AND type = $2\n ORDER BY created DESC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "version_", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "type_", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "created", + "ordinal": 3, "type_info": "Timestamptz" }, { - "ordinal": 4, "name": "major", + "ordinal": 4, "type_info": "Bool" } ], + "nullable": [ + false, + false, + false, + false, + false + ], "parameters": { "Left": [ "Bool", "Text" ] - }, - "nullable": [ - false, - false, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major major FROM game_versions gv\n WHERE major = $1 AND type = $2\n ORDER BY created DESC\n " }, "44bb1034872a80bbea122e04399470fd5f029b819c70cb6e0cb2db6d3193b97e": { - "query": "\n INSERT INTO loaders_project_types (joining_loader_id, joining_project_type_id)\n VALUES ($1, $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int4" ] - }, - "nullable": [] - } - }, - "45f8a06abdd17fc437f5355ad109efcb5d7e247ef397b1a0cd98d7fb6bd9ce17": { - "query": "\n INSERT INTO mods_categories (joining_mod_id, joining_category_id)\n VALUES ($1, $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int4" - ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO loaders_project_types (joining_loader_id, joining_project_type_id)\n VALUES ($1, $2)\n " }, "48294a4e0c594e80fff8d14a705aa7282f55e47cf3772e77f1d4bf4849008b60": { - "query": "\n SELECT follower_id FROM mod_follows\n WHERE mod_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "follower_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT follower_id FROM mod_follows\n WHERE mod_id = $1\n " }, "49a5d21a1454afc6383b78e468fd0decc75b9163e7286f34ceab22d563a0d3f7": { - "query": "UPDATE mods\n SET downloads = downloads + 1\n WHERE (id = $1)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "UPDATE mods\n SET downloads = downloads + 1\n WHERE (id = $1)" }, "4a4b4166248877eefcd63603945fdcd392f76812bdec7c70f8ffeb06ee7e737f": { - "query": "\n SELECT m.id FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id\n WHERE tm.user_id = $1 AND tm.role = $2\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT m.id FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id\n WHERE tm.user_id = $1 AND tm.role = $2\n " }, "4a54d350b4695c32a802675506e85b0506fc62a63ca0ee5f38890824301d6515": { - "query": "\n UPDATE mods\n SET server_side = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET server_side = $1\n WHERE (id = $2)\n " }, "4b14b5c69f6a0ee4e06e41d7cea425c7c34d6db45895275a2ce8adfa28dc8f72": { - "query": "\n INSERT INTO project_types (name)\n VALUES ($1)\n ON CONFLICT (name) DO NOTHING\n RETURNING id\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Varchar" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n INSERT INTO project_types (name)\n VALUES ($1)\n ON CONFLICT (name) DO NOTHING\n RETURNING id\n " }, "4b305fba5341b183cc07048aef48dc593c7a2fdf7abb82f7440e5a63786ebe7b": { - "query": "\n SELECT id, user_id, role, permissions, accepted\n FROM team_members\n WHERE (team_id = $1 AND user_id = $2 AND accepted = TRUE)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "user_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "role", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "permissions", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "accepted", + "ordinal": 4, "type_info": "Bool" } ], + "nullable": [ + false, + false, + false, + false, + false + ], "parameters": { "Left": [ "Int8", "Int8" ] - }, + } + }, + "query": "\n SELECT id, user_id, role, permissions, accepted\n FROM team_members\n WHERE (team_id = $1 AND user_id = $2 AND accepted = TRUE)\n " + }, + "4c0ddff96476162ed90800cc91147edec58f12d6d2bc09e67308ed678ac7009f": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + }, + { + "name": "category", + "ordinal": 1, + "type_info": "Varchar" + }, + { + "name": "icon", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "header", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "project_type", + "ordinal": 4, + "type_info": "Varchar" + } + ], "nullable": [ false, false, false, false, false - ] - } + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT c.id id, c.category category, c.icon icon, c.header header, pt.name project_type\n FROM categories c\n INNER JOIN project_types pt ON c.project_type = pt.id\n ORDER BY c.id\n " }, "4ccf5373d9593fd19622dba270ae2b194f8029f2fb05ad00ff6b3f2ac4d589b0": { - "query": "\n SELECT m.id FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.accepted = TRUE\n WHERE tm.user_id = $1 AND m.status = (SELECT s.id FROM statuses s WHERE s.status = $2)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT m.id FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.accepted = TRUE\n WHERE tm.user_id = $1 AND m.status = (SELECT s.id FROM statuses s WHERE s.status = $2)\n " }, "4cfafb61d38608152743c38cb8fb9a9c35e788fcbefe6f7f81476a3f144af3f8": { - "query": "\n SELECT id FROM mods\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM mods\n WHERE id = $1\n " }, "4d54032b02c860f4facec39eacb4548a0701d4505e7a80b4834650696df69c2b": { - "query": "UPDATE versions\n SET downloads = downloads + 1\n WHERE (id = $1)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "UPDATE versions\n SET downloads = downloads + 1\n WHERE (id = $1)" }, "4d752ee3f43a1bf34d71c4391c9232537e0941294951f383ea8fa61e9d83fc96": { - "query": "\n DELETE FROM mods_gallery\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM mods_gallery\n WHERE id = $1\n " }, "4e9f9eafbfd705dfc94571018cb747245a98ea61bad3fae4b3ce284229d99955": { - "query": "\n UPDATE mods\n SET description = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET description = $1\n WHERE (id = $2)\n " }, "4f307a8851b0cab7870798ba017955c8ebaba7444791dd65ffebcbac32d3585d": { - "query": "\n INSERT INTO states (id, url)\n VALUES ($1, $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO states (id, url)\n VALUES ($1, $2)\n " }, "4fa53dab6de86711825c032077fbe4985d5edf8aeec9003be900d162f46b3631": { - "query": "\n DELETE FROM loaders_project_types\n WHERE joining_loader_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM loaders_project_types\n WHERE joining_loader_id = $1\n " }, "4fb5bd341369b4beb6b4a88de296b608ea5441a96db9f7360fbdccceb4628202": { - "query": "\n UPDATE mods\n SET slug = LOWER($1)\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET slug = LOWER($1)\n WHERE (id = $2)\n " }, "507314fdcacaa3c7751738c9d0baee2b90aec719b6b203f922824eced5ea8369": { - "query": "\n DELETE FROM game_versions_versions WHERE joining_version_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM game_versions_versions WHERE joining_version_id = $1\n " + }, + "5295fba2053675c8414c0b37a59943535b9a438a642ea1c68045e987f05ade13": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + }, + { + "name": "loader", + "ordinal": 1, + "type_info": "Varchar" + }, + { + "name": "icon", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "project_types", + "ordinal": 3, + "type_info": "VarcharArray" + } + ], + "nullable": [ + false, + false, + false, + null + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT l.id id, l.loader loader, l.icon icon,\n ARRAY_AGG(DISTINCT pt.name) filter (where pt.name is not null) project_types\n FROM loaders l\n LEFT OUTER JOIN loaders_project_types lpt ON joining_loader_id = l.id\n LEFT OUTER JOIN project_types pt ON lpt.joining_project_type_id = pt.id\n GROUP BY l.id;\n " }, "53a8966ac345cc334ad65ea907be81af74e90b1217696c7eedcf8a8e3fca736e": { - "query": "\n UPDATE versions\n SET version_number = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE versions\n SET version_number = $1\n WHERE (id = $2)\n " }, "548dac1d87fb7280c065e18577c10590ba727e76a4e52d9e694a6c021d332708": { - "query": "\n SELECT v.mod_id, v.author_id, v.name, v.version_number,\n v.changelog, v.changelog_url, v.date_published, v.downloads,\n v.version_type, v.featured\n FROM versions v\n WHERE v.id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "mod_id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "author_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "name", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "version_number", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "changelog", + "ordinal": 4, "type_info": "Varchar" }, { - "ordinal": 5, "name": "changelog_url", + "ordinal": 5, "type_info": "Varchar" }, { - "ordinal": 6, "name": "date_published", + "ordinal": 6, "type_info": "Timestamptz" }, { - "ordinal": 7, "name": "downloads", + "ordinal": 7, "type_info": "Int4" }, { - "ordinal": 8, "name": "version_type", + "ordinal": 8, "type_info": "Varchar" }, { - "ordinal": 9, "name": "featured", + "ordinal": 9, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, false, @@ -1776,50 +1991,49 @@ false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT v.mod_id, v.author_id, v.name, v.version_number,\n v.changelog, v.changelog_url, v.date_published, v.downloads,\n v.version_type, v.featured\n FROM versions v\n WHERE v.id = $1\n " }, "5564434408e4b88ff1bdd14e0d32a35136e5ee0c837655fbde7d3ca9182dc25b": { - "query": "\n SELECT tm.id, tm.team_id, tm.user_id, tm.role, tm.permissions, tm.accepted FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND user_id = $2 AND accepted = TRUE\n WHERE m.id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "team_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "user_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "role", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "permissions", + "ordinal": 4, "type_info": "Int8" }, { - "ordinal": 5, "name": "accepted", + "ordinal": 5, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, "nullable": [ false, false, @@ -1827,292 +2041,354 @@ false, false, false - ] - } - }, - "560c3ba57c965c3ebdbe393b062da8a30a8a7116a9bace2aa7de2e8431fe0bc7": { - "query": "\n INSERT INTO mods_categories (joining_mod_id, joining_category_id)\n VALUES ($1, $2)\n ", - "describe": { - "columns": [], + ], "parameters": { "Left": [ "Int8", - "Int4" + "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n SELECT tm.id, tm.team_id, tm.user_id, tm.role, tm.permissions, tm.accepted FROM mods m\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND user_id = $2 AND accepted = TRUE\n WHERE m.id = $1\n " }, "57a38641fe5bdb273190e8d586f46284340b9ff11b6ae3177923631a37bb11eb": { - "query": "\n UPDATE mods\n SET moderation_message = NULL\n WHERE (id = $1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET moderation_message = NULL\n WHERE (id = $1)\n " }, "57bb3db92e6a8fb8606005be955e2379f13a04f101f91358322a591a860a7f9e": { - "query": "\n SELECT id FROM reports\n ORDER BY created ASC\n LIMIT $1;\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM reports\n ORDER BY created ASC\n LIMIT $1;\n " }, "57ff857e0d7f6deab7da6e806b83c61648809c8820cf1a46e833ff97583fe888": { - "query": "\n SELECT DISTINCT ON(v.date_published, v.id) version_id, v.date_published FROM versions v\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id\n INNER JOIN game_versions gv on gvv.game_version_id = gv.id AND (cardinality($2::varchar[]) = 0 OR gv.version = ANY($2::varchar[]))\n INNER JOIN loaders_versions lv ON lv.version_id = v.id\n INNER JOIN loaders l on lv.loader_id = l.id AND (cardinality($3::varchar[]) = 0 OR l.loader = ANY($3::varchar[]))\n WHERE v.mod_id = $1\n ORDER BY v.date_published, v.id ASC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "version_id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "date_published", + "ordinal": 1, "type_info": "Timestamptz" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "Int8", "VarcharArray", "VarcharArray" ] - }, - "nullable": [ - false, - false - ] - } + } + }, + "query": "\n SELECT DISTINCT ON(v.date_published, v.id) version_id, v.date_published FROM versions v\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id\n INNER JOIN game_versions gv on gvv.game_version_id = gv.id AND (cardinality($2::varchar[]) = 0 OR gv.version = ANY($2::varchar[]))\n INNER JOIN loaders_versions lv ON lv.version_id = v.id\n INNER JOIN loaders l on lv.loader_id = l.id AND (cardinality($3::varchar[]) = 0 OR l.loader = ANY($3::varchar[]))\n WHERE v.mod_id = $1\n ORDER BY v.date_published, v.id ASC\n " }, "5917ab5017e27be2c4c5231426b19c3b37fd171ff47f97a0cb4e2094a0234298": { - "query": "\n SELECT id, name FROM project_types\n WHERE name = ANY($1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "name", + "ordinal": 1, "type_info": "Varchar" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "TextArray" ] - }, - "nullable": [ - false, - false - ] - } + } + }, + "query": "\n SELECT id, name FROM project_types\n WHERE name = ANY($1)\n " }, "599df07263a2705e57fc70a7c4f5dc606e1730c281e3b573d2f2a2030bed04e0": { - "query": "\n DELETE FROM notifications\n WHERE id = ANY($1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8Array" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM notifications\n WHERE id = ANY($1)\n " }, "5a13a79ebb1ab975f88b58e6deaba9685fe16e242c0fa4a5eea54f12f9448e6b": { - "query": "\n DELETE FROM reports\n WHERE version_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM reports\n WHERE version_id = $1\n " }, "5ad1f23da1b6f0f613de3412b928d2677a0359111dab4174e69ef6b0ef78202b": { - "query": "\n SELECT rt.name, r.mod_id, r.version_id, r.user_id, r.body, r.reporter, r.created\n FROM reports r\n INNER JOIN report_types rt ON rt.id = r.report_type_id\n WHERE r.id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "mod_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "version_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "user_id", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "body", + "ordinal": 4, "type_info": "Varchar" }, { - "ordinal": 5, "name": "reporter", + "ordinal": 5, "type_info": "Int8" }, { - "ordinal": 6, "name": "created", + "ordinal": 6, "type_info": "Timestamptz" } ], + "nullable": [ + false, + true, + true, + true, + false, + false, + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false, - true, - true, - true, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT rt.name, r.mod_id, r.version_id, r.user_id, r.body, r.reporter, r.created\n FROM reports r\n INNER JOIN report_types rt ON rt.id = r.report_type_id\n WHERE r.id = $1\n " }, "5c3b340d278c356b6bc2cd7110e5093a7d1ad982ae0f468f8fff7c54e4e6603a": { - "query": "\n SELECT id FROM project_types\n WHERE name = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM project_types\n WHERE name = $1\n " }, "5c4262689205aafdd97a74bee0003f39eef0a34c97f97a939c14fb8fe349f7eb": { - "query": "\n UPDATE files\n SET is_primary = TRUE\n WHERE (id = $1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE files\n SET is_primary = TRUE\n WHERE (id = $1)\n " }, "5ca43f2fddda27ad857f230a3427087f1e58150949adc6273156718730c10f69": { - "query": "\n UPDATE users\n SET role = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE users\n SET role = $1\n WHERE (id = $2)\n " }, "5d7425cfa91e332bf7cc14aa5c300b997e941c49757606f6b906cb5e060d3179": { - "query": "\n UPDATE mods\n SET updated = NOW()\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET updated = NOW()\n WHERE id = $1\n " }, "5d7d7e33c2952199225d7b93f5a74f3436ba18aa24e6ef1840becbf236447fd6": { - "query": "\n DELETE FROM mod_follows\n WHERE mod_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM mod_follows\n WHERE mod_id = $1\n " }, "5eb2795d25d6d03e22564048c198d821cd5ff22eb4e39b9dd7f198c9113d4f87": { - "query": "\n UPDATE users\n SET name = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE users\n SET name = $1\n WHERE (id = $2)\n " }, "5ee2dc5cda9bfc0395da5a4ebf234093e9b8135db5e4a0258b00fa16fb825faa": { - "query": "\n SELECT name FROM project_types\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], - "parameters": { - "Left": [] - }, "nullable": [ false - ] - } + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT name FROM project_types\n " + }, + "5f3f68b438571369e7fe6dba08935faa71e7f53fcdcb6d5b3c25feb15adc4f23": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "user_id", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "title", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "text", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "link", + "ordinal": 4, + "type_info": "Varchar" + }, + { + "name": "created", + "ordinal": 5, + "type_info": "Timestamptz" + }, + { + "name": "read", + "ordinal": 6, + "type_info": "Bool" + }, + { + "name": "notification_type", + "ordinal": 7, + "type_info": "Varchar" + }, + { + "name": "actions", + "ordinal": 8, + "type_info": "TextArray" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + true, + null + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT n.id, n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type,\n ARRAY_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method) filter (where na.id is not null) actions\n FROM notifications n\n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id\n WHERE n.user_id = $1\n GROUP BY n.id, n.user_id;\n " }, "5f94e9e767ec4be7f9136b991b4a29373dbe48feb2f61281e3212721095ed675": { - "query": "\n INSERT INTO dependencies (dependent_id, dependency_type, dependency_id, mod_dependency_id, dependency_file_name)\n VALUES ($1, $2, $3, $4, $5)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -2121,73 +2397,303 @@ "Int8", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO dependencies (dependent_id, dependency_type, dependency_id, mod_dependency_id, dependency_file_name)\n VALUES ($1, $2, $3, $4, $5)\n " }, "6131d32a65f5e04775308386812f25c6d8464582678536a392a4a3737667f363": { - "query": "\n SELECT id, short, name FROM licenses\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "short", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "name", + "ordinal": 2, "type_info": "Varchar" } ], - "parameters": { - "Left": [] - }, "nullable": [ false, false, false - ] - } + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT id, short, name FROM licenses\n " }, "61a7f29e024bf2f1368370e3f6e8ef70317c7e8545b5b6d4235f21164948ba27": { - "query": "\n UPDATE mods_gallery\n SET featured = $2\n WHERE mod_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Bool" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods_gallery\n SET featured = $2\n WHERE mod_id = $1\n " }, "62416ea5972daa46ff2d077f631a8a30d9ec922056cf7ff1b0d74d9511010c96": { - "query": "\n SELECT version.id id FROM (\n SELECT DISTINCT ON(v.id) v.id, v.date_published FROM versions v\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id AND gvv.game_version_id IN (SELECT game_version_id FROM game_versions_versions WHERE joining_version_id = $2)\n INNER JOIN loaders_versions lv ON lv.version_id = v.id AND lv.loader_id IN (SELECT loader_id FROM loaders_versions WHERE version_id = $2)\n WHERE v.mod_id = $1\n ) AS version\n ORDER BY version.date_published DESC\n LIMIT 1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8", "Int8" ] - }, + } + }, + "query": "\n SELECT version.id id FROM (\n SELECT DISTINCT ON(v.id) v.id, v.date_published FROM versions v\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id AND gvv.game_version_id IN (SELECT game_version_id FROM game_versions_versions WHERE joining_version_id = $2)\n INNER JOIN loaders_versions lv ON lv.version_id = v.id AND lv.loader_id IN (SELECT loader_id FROM loaders_versions WHERE version_id = $2)\n WHERE v.mod_id = $1\n ) AS version\n ORDER BY version.date_published DESC\n LIMIT 1\n " + }, + "63ad3ff39dfbc95401093d6a8577003b320b8c23529d50fa10a9a18aa198569c": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "project_type", + "ordinal": 1, + "type_info": "Int4" + }, + { + "name": "title", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "description", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "downloads", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "follows", + "ordinal": 5, + "type_info": "Int4" + }, + { + "name": "icon_url", + "ordinal": 6, + "type_info": "Varchar" + }, + { + "name": "body", + "ordinal": 7, + "type_info": "Varchar" + }, + { + "name": "body_url", + "ordinal": 8, + "type_info": "Varchar" + }, + { + "name": "published", + "ordinal": 9, + "type_info": "Timestamptz" + }, + { + "name": "updated", + "ordinal": 10, + "type_info": "Timestamptz" + }, + { + "name": "approved", + "ordinal": 11, + "type_info": "Timestamptz" + }, + { + "name": "status", + "ordinal": 12, + "type_info": "Int4" + }, + { + "name": "issues_url", + "ordinal": 13, + "type_info": "Varchar" + }, + { + "name": "source_url", + "ordinal": 14, + "type_info": "Varchar" + }, + { + "name": "wiki_url", + "ordinal": 15, + "type_info": "Varchar" + }, + { + "name": "discord_url", + "ordinal": 16, + "type_info": "Varchar" + }, + { + "name": "license_url", + "ordinal": 17, + "type_info": "Varchar" + }, + { + "name": "team_id", + "ordinal": 18, + "type_info": "Int8" + }, + { + "name": "client_side", + "ordinal": 19, + "type_info": "Int4" + }, + { + "name": "server_side", + "ordinal": 20, + "type_info": "Int4" + }, + { + "name": "license", + "ordinal": 21, + "type_info": "Int4" + }, + { + "name": "slug", + "ordinal": 22, + "type_info": "Varchar" + }, + { + "name": "moderation_message", + "ordinal": 23, + "type_info": "Varchar" + }, + { + "name": "moderation_message_body", + "ordinal": 24, + "type_info": "Varchar" + }, + { + "name": "status_name", + "ordinal": 25, + "type_info": "Varchar" + }, + { + "name": "client_side_type", + "ordinal": 26, + "type_info": "Varchar" + }, + { + "name": "server_side_type", + "ordinal": 27, + "type_info": "Varchar" + }, + { + "name": "short", + "ordinal": 28, + "type_info": "Varchar" + }, + { + "name": "license_name", + "ordinal": 29, + "type_info": "Varchar" + }, + { + "name": "project_type_name", + "ordinal": 30, + "type_info": "Varchar" + }, + { + "name": "categories", + "ordinal": 31, + "type_info": "VarcharArray" + }, + { + "name": "additional_categories", + "ordinal": 32, + "type_info": "VarcharArray" + }, + { + "name": "versions", + "ordinal": 33, + "type_info": "TextArray" + }, + { + "name": "gallery", + "ordinal": 34, + "type_info": "TextArray" + }, + { + "name": "donations", + "ordinal": 35, + "type_info": "TextArray" + } + ], "nullable": [ - false - ] - } + false, + false, + false, + false, + false, + false, + true, + false, + true, + false, + false, + true, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + null, + null, + null, + null, + null + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,\n m.icon_url icon_url, m.body body, m.body_url body_url, m.published published,\n m.updated updated, m.approved approved, m.status status,\n m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url,\n m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body,\n s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, l.name license_name, pt.name project_type_name,\n ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories,\n ARRAY_AGG(DISTINCT ca.category) filter (where ca.category is not null) additional_categories,\n ARRAY_AGG(DISTINCT v.id || ' |||| ' || v.date_published) filter (where v.id is not null) versions,\n ARRAY_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' ')) filter (where mg.image_url is not null) gallery,\n ARRAY_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url) filter (where md.joining_platform_id is not null) donations\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN statuses s ON s.id = m.status\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN licenses l ON m.license = l.id\n LEFT JOIN mods_donations md ON md.joining_mod_id = m.id\n LEFT JOIN donation_platforms dp ON md.joining_platform_id = dp.id\n LEFT JOIN mods_categories mc ON mc.joining_mod_id = m.id\n LEFT JOIN categories c ON mc.joining_category_id = c.id\n LEFT JOIN categories ca ON mc.joining_category_id = c.id AND mc.is_additional = TRUE\n LEFT JOIN versions v ON v.mod_id = m.id\n LEFT JOIN mods_gallery mg ON mg.mod_id = m.id\n WHERE m.id = $1\n GROUP BY pt.id, s.id, cs.id, ss.id, l.id, m.id;\n " }, "64570e9cadd7391ad45a1029a0e5212e17720c4f65682384d7493fc350114228": { "describe": { @@ -2241,561 +2747,113 @@ "query": "\n SELECT id, team_id, user_id, role, permissions, accepted\n FROM team_members\n WHERE (team_id = ANY($1) AND user_id = $2 AND accepted = TRUE)\n " }, "67d021f0776276081d3c50ca97afa6b78b98860bf929009e845e9c00a192e3b5": { - "query": "\n SELECT id FROM report_types\n WHERE name = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM report_types\n WHERE name = $1\n " }, "68f0e36e5dde4d05955de634227f3e65d16730e0ff260c7a33eff89b5f2ee972": { - "query": "\n SELECT v.id id, v.mod_id project_id FROM files f\n INNER JOIN versions v ON v.id = f.version_id\n WHERE f.url = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "project_id", + "ordinal": 1, "type_info": "Int8" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false, - false - ] - } - }, - "690aaaefb15196c0b9b9a79fd819ffb7160b559e5703e11ccea3990bc96e6e5c": { - "query": "\n SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,\n m.icon_url icon_url, m.body body, m.body_url body_url, m.published published,\n m.updated updated, m.status status,\n m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url,\n m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body,\n s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, l.name license_name, pt.name project_type_name,\n STRING_AGG(DISTINCT c.category, ' ~~~~ ') categories, STRING_AGG(DISTINCT v.id::text, ' ~~~~ ') versions,\n STRING_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' '), ' ~~~~ ') gallery,\n STRING_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url, ' ~~~~ ') donations\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN statuses s ON s.id = m.status\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN licenses l ON m.license = l.id\n LEFT JOIN mods_donations md ON md.joining_mod_id = m.id\n LEFT JOIN donation_platforms dp ON md.joining_platform_id = dp.id\n LEFT JOIN mods_categories mc ON mc.joining_mod_id = m.id\n LEFT JOIN categories c ON mc.joining_category_id = c.id\n LEFT JOIN versions v ON v.mod_id = m.id\n LEFT JOIN mods_gallery mg ON mg.mod_id = m.id\n WHERE m.id = $1\n GROUP BY pt.id, s.id, cs.id, ss.id, l.id, m.id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "project_type", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "description", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "downloads", - "type_info": "Int4" - }, - { - "ordinal": 5, - "name": "follows", - "type_info": "Int4" - }, - { - "ordinal": 6, - "name": "icon_url", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "body", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "body_url", - "type_info": "Varchar" - }, - { - "ordinal": 9, - "name": "published", - "type_info": "Timestamptz" - }, - { - "ordinal": 10, - "name": "updated", - "type_info": "Timestamptz" - }, - { - "ordinal": 11, - "name": "status", - "type_info": "Int4" - }, - { - "ordinal": 12, - "name": "issues_url", - "type_info": "Varchar" - }, - { - "ordinal": 13, - "name": "source_url", - "type_info": "Varchar" - }, - { - "ordinal": 14, - "name": "wiki_url", - "type_info": "Varchar" - }, - { - "ordinal": 15, - "name": "discord_url", - "type_info": "Varchar" - }, - { - "ordinal": 16, - "name": "license_url", - "type_info": "Varchar" - }, - { - "ordinal": 17, - "name": "team_id", - "type_info": "Int8" - }, - { - "ordinal": 18, - "name": "client_side", - "type_info": "Int4" - }, - { - "ordinal": 19, - "name": "server_side", - "type_info": "Int4" - }, - { - "ordinal": 20, - "name": "license", - "type_info": "Int4" - }, - { - "ordinal": 21, - "name": "slug", - "type_info": "Varchar" - }, - { - "ordinal": 22, - "name": "moderation_message", - "type_info": "Varchar" - }, - { - "ordinal": 23, - "name": "moderation_message_body", - "type_info": "Varchar" - }, - { - "ordinal": 24, - "name": "status_name", - "type_info": "Varchar" - }, - { - "ordinal": 25, - "name": "client_side_type", - "type_info": "Varchar" - }, - { - "ordinal": 26, - "name": "server_side_type", - "type_info": "Varchar" - }, - { - "ordinal": 27, - "name": "short", - "type_info": "Varchar" - }, - { - "ordinal": 28, - "name": "license_name", - "type_info": "Varchar" - }, - { - "ordinal": 29, - "name": "project_type_name", - "type_info": "Varchar" - }, - { - "ordinal": 30, - "name": "categories", - "type_info": "Text" - }, - { - "ordinal": 31, - "name": "versions", - "type_info": "Text" - }, - { - "ordinal": 32, - "name": "gallery", - "type_info": "Text" - }, - { - "ordinal": 33, - "name": "donations", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - true, - false, - true, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - null, - null, - null, - null - ] - } - }, - "6915fae5046160623c92ffab1de2dfebf976dc6a3d9fa579c3c1fde75bd854ed": { - "query": "\n SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,\n m.icon_url icon_url, m.body body, m.body_url body_url, m.published published,\n m.updated updated, m.status status,\n m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url,\n m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body,\n s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, l.name license_name, pt.name project_type_name,\n STRING_AGG(DISTINCT c.category, ' ~~~~ ') categories, STRING_AGG(DISTINCT v.id::text, ' ~~~~ ') versions,\n STRING_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' '), ' ~~~~ ') gallery,\n STRING_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url, ' ~~~~ ') donations\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN statuses s ON s.id = m.status\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN licenses l ON m.license = l.id\n LEFT JOIN mods_donations md ON md.joining_mod_id = m.id\n LEFT JOIN donation_platforms dp ON md.joining_platform_id = dp.id\n LEFT JOIN mods_categories mc ON mc.joining_mod_id = m.id\n LEFT JOIN categories c ON mc.joining_category_id = c.id\n LEFT JOIN versions v ON v.mod_id = m.id\n LEFT JOIN mods_gallery mg ON mg.mod_id = m.id\n WHERE m.id = ANY($1)\n GROUP BY pt.id, s.id, cs.id, ss.id, l.id, m.id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "project_type", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "description", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "downloads", - "type_info": "Int4" - }, - { - "ordinal": 5, - "name": "follows", - "type_info": "Int4" - }, - { - "ordinal": 6, - "name": "icon_url", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "body", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "body_url", - "type_info": "Varchar" - }, - { - "ordinal": 9, - "name": "published", - "type_info": "Timestamptz" - }, - { - "ordinal": 10, - "name": "updated", - "type_info": "Timestamptz" - }, - { - "ordinal": 11, - "name": "status", - "type_info": "Int4" - }, - { - "ordinal": 12, - "name": "issues_url", - "type_info": "Varchar" - }, - { - "ordinal": 13, - "name": "source_url", - "type_info": "Varchar" - }, - { - "ordinal": 14, - "name": "wiki_url", - "type_info": "Varchar" - }, - { - "ordinal": 15, - "name": "discord_url", - "type_info": "Varchar" - }, - { - "ordinal": 16, - "name": "license_url", - "type_info": "Varchar" - }, - { - "ordinal": 17, - "name": "team_id", - "type_info": "Int8" - }, - { - "ordinal": 18, - "name": "client_side", - "type_info": "Int4" - }, - { - "ordinal": 19, - "name": "server_side", - "type_info": "Int4" - }, - { - "ordinal": 20, - "name": "license", - "type_info": "Int4" - }, - { - "ordinal": 21, - "name": "slug", - "type_info": "Varchar" - }, - { - "ordinal": 22, - "name": "moderation_message", - "type_info": "Varchar" - }, - { - "ordinal": 23, - "name": "moderation_message_body", - "type_info": "Varchar" - }, - { - "ordinal": 24, - "name": "status_name", - "type_info": "Varchar" - }, - { - "ordinal": 25, - "name": "client_side_type", - "type_info": "Varchar" - }, - { - "ordinal": 26, - "name": "server_side_type", - "type_info": "Varchar" - }, - { - "ordinal": 27, - "name": "short", - "type_info": "Varchar" - }, - { - "ordinal": 28, - "name": "license_name", - "type_info": "Varchar" - }, - { - "ordinal": 29, - "name": "project_type_name", - "type_info": "Varchar" - }, - { - "ordinal": 30, - "name": "categories", - "type_info": "Text" - }, - { - "ordinal": 31, - "name": "versions", - "type_info": "Text" - }, - { - "ordinal": 32, - "name": "gallery", - "type_info": "Text" - }, - { - "ordinal": 33, - "name": "donations", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - true, - false, - true, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - null, - null, - null, - null - ] - } + } + }, + "query": "\n SELECT v.id id, v.mod_id project_id FROM files f\n INNER JOIN versions v ON v.id = f.version_id\n WHERE f.url = $1\n " }, "6a7b7704c2a0c52a70f5d881a1e6d3e8e77ddaa83ecc5688cd86bf327775fb76": { - "query": "\n SELECT f.id id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n WHERE h.algorithm = $2 AND h.hash = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Bytea", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT f.id id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n WHERE h.algorithm = $2 AND h.hash = $1\n " }, "6b28cb8b54ef57c9b6f03607611f688455f0e2b27eb5deda5a8cbc5b506b4602": { - "query": "\n DELETE FROM mods\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM mods\n WHERE id = $1\n " }, "6c7aeb0db4a4fb3387c37b8d7aca6fdafaa637fd883a44416b56270aeebb7a01": { - "query": "\n INSERT INTO loaders_versions (loader_id, version_id)\n VALUES ($1, $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO loaders_versions (loader_id, version_id)\n VALUES ($1, $2)\n " }, "6d883ea05aead20f571a0f63bfd63f1d432717ec7a0fb9ab29e01fcb061b3afc": { - "query": "\n UPDATE files\n SET is_primary = FALSE\n WHERE (version_id = $1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } - }, - "6f1fb4c3269b2a8190f328df025be76241eae757d9c4f3e5eb1cc01b191837df": { - "query": "\n DELETE FROM mods_categories\n WHERE joining_mod_id = $1\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE files\n SET is_primary = FALSE\n WHERE (version_id = $1)\n " }, "6fd06767f42be894c7a35c6b61f43407c55de43dc77ed02b39062278f3de81e3": { - "query": "\n INSERT INTO team_members (\n id, team_id, user_id, role, permissions, accepted\n )\n VALUES (\n $1, $2, $3, $4, $5, $6\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -2805,324 +2863,316 @@ "Int8", "Bool" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO team_members (\n id, team_id, user_id, role, permissions, accepted\n )\n VALUES (\n $1, $2, $3, $4, $5, $6\n )\n " }, "70cdf1b4a17405974909d89b1437a8425792d620f9ed67fd8e31e004e4609e83": { - "query": "\n UPDATE users\n SET username = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE users\n SET username = $1\n WHERE (id = $2)\n " }, "712a846d6b56609599ee7a6603ad921acd2d5da2b3ce0c5b3f3642ed83927542": { - "query": "\n UPDATE dependencies\n SET dependency_id = $2\n WHERE id = ANY($1::bigint[])\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8Array", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE dependencies\n SET dependency_id = $2\n WHERE id = ANY($1::bigint[])\n " }, - "71ed9925d14b7df822fad05983b55717ba61859fb7c9d2ae1929cd89608889cc": { - "query": "\n SELECT id FROM mods\n WHERE LOWER(slug) = LOWER($1)\n ", + "729ca6f7065c1e189a0ddb9ca28d86d86f9685efcbfc805d137be080f97d13d5": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n UPDATE mods\n SET published = NOW()\n WHERE id = $1 AND approved = NULL\n " + }, + "72ad6f4be40d7620a0ec557e3806da41ce95335aeaa910fe35aca2ec7c3f09b6": { "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], - "parameters": { - "Left": [ - "Text" - ] - }, "nullable": [ false - ] - } - }, - "72ad6f4be40d7620a0ec557e3806da41ce95335aeaa910fe35aca2ec7c3f09b6": { - "query": "\n SELECT id FROM users\n WHERE id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - } ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM users\n WHERE id = $1\n " }, "72c75313688dfd88a659c5250c71b9899abd6186ab32a067a7d4b8a0846ebd18": { - "query": "\n INSERT INTO game_versions (version, type, created)\n VALUES ($1, COALESCE($2, 'other'), COALESCE($3, timezone('utc', now())))\n ON CONFLICT (version) DO UPDATE\n SET type = COALESCE($2, game_versions.type),\n created = COALESCE($3, game_versions.created)\n RETURNING id\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Varchar", "Text", "Timestamp" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n INSERT INTO game_versions (version, type, created)\n VALUES ($1, COALESCE($2, 'other'), COALESCE($3, timezone('utc', now())))\n ON CONFLICT (version) DO UPDATE\n SET type = COALESCE($2, game_versions.type),\n created = COALESCE($3, game_versions.created)\n RETURNING id\n " }, "72d6b5f2f11d88981db82c7247c9e7e5ebfd8d34985a1a8209d6628e66490f37": { - "query": "\n SELECT id FROM categories\n WHERE category = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM categories\n WHERE category = $1\n " }, "73bdd6c9e7cd8c1ed582261aebdee0f8fd2734e712ef288a2608564c918009cb": { - "query": "\n DELETE FROM versions WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM versions WHERE id = $1\n " }, "740424ba1af7b0cf85d6031365d2c026e0b0003fb618bb82eeebcdad9599774a": { - "query": "\n SELECT v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = $1 AND s.status != $3\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "project_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Bytea", "Text", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = $1 AND s.status != $3\n " }, "75a860ca8087536a9fcf932846341c8bd322d314231bb8acac124d1cea93270b": { - "query": "\n SELECT mf.mod_id FROM mod_follows mf\n WHERE mf.follower_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "mod_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT mf.mod_id FROM mod_follows mf\n WHERE mf.follower_id = $1\n " }, "76db1c204139e18002e5751c3dcefff79791a1dd852b62d34fcf008151e8945a": { - "query": "\n SELECT id, short, name FROM donation_platforms\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "short", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "name", + "ordinal": 2, "type_info": "Varchar" } ], - "parameters": { - "Left": [] - }, "nullable": [ false, false, false - ] - } + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT id, short, name FROM donation_platforms\n " }, "78a60cf0febcc6e35b8ffe38f2c021c13ab660c81c4775bbb26004d30242a1a8": { - "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major major FROM game_versions gv\n WHERE major = $1\n ORDER BY created DESC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "version_", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "type_", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "created", + "ordinal": 3, "type_info": "Timestamptz" }, { - "ordinal": 4, "name": "major", + "ordinal": 4, "type_info": "Bool" } ], + "nullable": [ + false, + false, + false, + false, + false + ], "parameters": { "Left": [ "Bool" ] - }, - "nullable": [ - false, - false, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major major FROM game_versions gv\n WHERE major = $1\n ORDER BY created DESC\n " }, "78bf8232ddae2db486b9ff791ea525af1330e6904740b2a943c4ae3466bf02d0": { - "query": "\n SELECT game_version_id id FROM game_versions_versions\n WHERE joining_version_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT game_version_id id FROM game_versions_versions\n WHERE joining_version_id = $1\n " }, "796f057ea8eb5b01d3eedeee9840fb37464ea567f32871953fb07e14ed86af1c": { - "query": "SELECT EXISTS(SELECT 1 FROM team_members WHERE team_id = $1 AND user_id = $2)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8", "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM team_members WHERE team_id = $1 AND user_id = $2)" }, "79b896b1a8ddab285294638302976b75d0d915f36036383cc21bd2fc48d4502c": { - "query": "\n DELETE FROM loaders_versions WHERE version_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM loaders_versions WHERE version_id = $1\n " }, "79d30dd9fe16ac93ece0b6272811e1b644bac8f61b446dceca46a16cb69953a1": { - "query": "\n SELECT f.version_id version_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n WHERE h.algorithm = $2 AND h.hash = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "version_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Bytea", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT f.version_id version_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n WHERE h.algorithm = $2 AND h.hash = $1\n " }, "7a3183f77f403d2272665727affb07775a9304cbe1fb8ee7e603d779edb95d03": { - "query": "\n INSERT INTO mods (\n id, team_id, title, description, body,\n published, downloads, icon_url, issues_url,\n source_url, wiki_url, status, discord_url,\n client_side, server_side, license_url, license,\n slug, project_type\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7, $8, $9,\n $10, $11, $12, $13,\n $14, $15, $16, $17,\n LOWER($18), $19\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -3145,106 +3195,113 @@ "Text", "Int4" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO mods (\n id, team_id, title, description, body,\n published, downloads, icon_url, issues_url,\n source_url, wiki_url, status, discord_url,\n client_side, server_side, license_url, license,\n slug, project_type\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7, $8, $9,\n $10, $11, $12, $13,\n $14, $15, $16, $17,\n LOWER($18), $19\n )\n " }, "7c61fee015231f0a97c25d24f2c6be24821e39e330ab82344ad3b985d0d2aaea": { - "query": "\n SELECT id FROM mods_gallery\n WHERE image_url = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM mods_gallery\n WHERE image_url = $1\n " }, "7cae1137ab3aaa8de1617d820fb5635eb7498e61174e79da3cdd0da7e99aaca3": { - "query": "SELECT EXISTS(SELECT 1 FROM versions WHERE (version_number = $1) AND (mod_id = $2))", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Text", "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM versions WHERE (version_number = $1) AND (mod_id = $2))" + }, + "7cb691738c28e0d1f28c84ba2dbcfa21a6dbd859bcf0f565f90cd7ce2ea5aa1c": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4" + ] + } + }, + "query": "\n INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional)\n VALUES ($1, $2, FALSE)\n " }, "7ecf1bdb78a03dbdee2e4a57d0914409751c13bdc8f01fa82c8001c2255e31a5": { - "query": "\n SELECT u.id, u.github_id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role\n FROM users u\n WHERE LOWER(u.username) = LOWER($1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "github_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "name", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "email", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "avatar_url", + "ordinal": 4, "type_info": "Varchar" }, { - "ordinal": 5, "name": "username", + "ordinal": 5, "type_info": "Varchar" }, { - "ordinal": 6, "name": "bio", + "ordinal": 6, "type_info": "Varchar" }, { - "ordinal": 7, "name": "created", + "ordinal": 7, "type_info": "Timestamptz" }, { - "ordinal": 8, "name": "role", + "ordinal": 8, "type_info": "Varchar" } ], - "parameters": { - "Left": [ - "Text" - ] - }, "nullable": [ false, true, @@ -3255,13 +3312,19 @@ true, false, false - ] - } + ], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "\n SELECT u.id, u.github_id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role\n FROM users u\n WHERE LOWER(u.username) = LOWER($1)\n " }, "8129255d25bf0624d83f50558b668ed7b7f9c264e380d276522fc82bc871939b": { - "query": "\n INSERT INTO notifications_actions (\n notification_id, title, action_route, action_route_method\n )\n VALUES (\n $1, $2, $3, $4\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -3269,72 +3332,65 @@ "Varchar", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO notifications_actions (\n notification_id, title, action_route, action_route_method\n )\n VALUES (\n $1, $2, $3, $4\n )\n " }, "82515e4e7e88f1193c956f032caabc70f535f925e212de30f974afd3ec126092": { - "query": "\n INSERT INTO licenses (short, name)\n VALUES ($1, $2)\n ON CONFLICT (short) DO NOTHING\n RETURNING id\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Varchar", "Varchar" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n INSERT INTO licenses (short, name)\n VALUES ($1, $2)\n ON CONFLICT (short) DO NOTHING\n RETURNING id\n " }, "82cc64ff6fc37cd52a6dee033d1d571a3e570abe0aa10aea9860cdb8d1ea8cdc": { - "query": "\n SELECT tm.id, tm.team_id, tm.user_id, tm.role, tm.permissions, tm.accepted FROM versions v\n INNER JOIN mods m ON m.id = v.mod_id\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.user_id = $2 AND tm.accepted = TRUE\n WHERE v.id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "team_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "user_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "role", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "permissions", + "ordinal": 4, "type_info": "Int8" }, { - "ordinal": 5, "name": "accepted", + "ordinal": 5, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, "nullable": [ false, false, @@ -3342,379 +3398,182 @@ false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + } + }, + "query": "\n SELECT tm.id, tm.team_id, tm.user_id, tm.role, tm.permissions, tm.accepted FROM versions v\n INNER JOIN mods m ON m.id = v.mod_id\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.user_id = $2 AND tm.accepted = TRUE\n WHERE v.id = $1\n " }, "87fd169e19ba231c6cf131ad2841d5c3b95adde53e5ed4000f8e7d54c0e87320": { - "query": "\n DELETE FROM project_types\n WHERE name = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } - }, - "885ca4b21e05079d30dcf3b65619c95b544a10b7b08c3184278a0fe5ebc44b86": { - "query": "\n SELECT c.id id, c.category category, c.icon icon, pt.name project_type\n FROM categories c\n INNER JOIN project_types pt ON c.project_type = pt.id\n ORDER BY c.id\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "category", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "icon", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "project_type", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false - ] - } + } + }, + "query": "\n DELETE FROM project_types\n WHERE name = $1\n " }, "89310b2bc5f020744a9a42dae6f15dfebc1544cdd754939f0d09714353f2aa7c": { - "query": "\n SELECT id, team_id, role, permissions, accepted\n FROM team_members\n WHERE user_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "team_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "role", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "permissions", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "accepted", + "ordinal": 4, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, false, false, false, false - ] - } - }, - "8b1dcd460baa345311275710a0c05c0c58764b91d50b3d6732b3dce8bf5bff6b": { - "query": "\n SELECT project_type, title, description, downloads, follows,\n icon_url, body, body_url, published,\n updated, status,\n issues_url, source_url, wiki_url, discord_url, license_url,\n team_id, client_side, server_side, license, slug,\n moderation_message, moderation_message_body\n FROM mods\n WHERE id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "project_type", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "description", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "downloads", - "type_info": "Int4" - }, - { - "ordinal": 4, - "name": "follows", - "type_info": "Int4" - }, - { - "ordinal": 5, - "name": "icon_url", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "body", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "body_url", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "published", - "type_info": "Timestamptz" - }, - { - "ordinal": 9, - "name": "updated", - "type_info": "Timestamptz" - }, - { - "ordinal": 10, - "name": "status", - "type_info": "Int4" - }, - { - "ordinal": 11, - "name": "issues_url", - "type_info": "Varchar" - }, - { - "ordinal": 12, - "name": "source_url", - "type_info": "Varchar" - }, - { - "ordinal": 13, - "name": "wiki_url", - "type_info": "Varchar" - }, - { - "ordinal": 14, - "name": "discord_url", - "type_info": "Varchar" - }, - { - "ordinal": 15, - "name": "license_url", - "type_info": "Varchar" - }, - { - "ordinal": 16, - "name": "team_id", - "type_info": "Int8" - }, - { - "ordinal": 17, - "name": "client_side", - "type_info": "Int4" - }, - { - "ordinal": 18, - "name": "server_side", - "type_info": "Int4" - }, - { - "ordinal": 19, - "name": "license", - "type_info": "Int4" - }, - { - "ordinal": 20, - "name": "slug", - "type_info": "Varchar" - }, - { - "ordinal": 21, - "name": "moderation_message", - "type_info": "Varchar" - }, - { - "ordinal": 22, - "name": "moderation_message_body", - "type_info": "Varchar" - } ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false, - false, - false, - false, - false, - true, - false, - true, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true - ] - } + } + }, + "query": "\n SELECT id, team_id, role, permissions, accepted\n FROM team_members\n WHERE user_id = $1\n " + }, + "8b867ee091fe5ffa83eea1a2ca12ce42c6649b84bf9b086f59a288708a61d32c": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n DELETE FROM mods_categories\n WHERE joining_mod_id = $1 AND is_additional = TRUE\n " }, "8ba2b2c38958f1c542e514fc62ab4682f58b0b442ac1842d20625420698e34ec": { - "query": "\n DELETE FROM team_members\n WHERE (team_id = $1 AND user_id = $2 AND NOT role = $3)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8", "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM team_members\n WHERE (team_id = $1 AND user_id = $2 AND NOT role = $3)\n " }, - "8bb8be81029b47af0c2a200647abcabb79cb88a41e53467ad3b52d714c83fdf9": { - "query": "\n INSERT INTO categories (category, project_type, icon)\n VALUES ($1, $2, $3)\n RETURNING id\n ", + "8ced4b7a1c4f944b918d2d2eefc8007a3fb9565021ca8c44608caccbe1ab9674": { "describe": { "columns": [ { - "ordinal": 0, "name": "id", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [ - "Varchar", - "Int4", - "Varchar" - ] - }, - "nullable": [ - false - ] - } - }, - "8c65c87d288ca385eee56f98a0880eac5bf73d2760af70b7d660ded5f7a619f2": { - "query": "\n SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number,\n v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads,\n v.version_type version_type, v.featured featured,\n STRING_AGG(DISTINCT gv.version || ' |||| ' || gv.created, ' ~~~~ ') game_versions, STRING_AGG(DISTINCT l.loader, ' ~~~~ ') loaders,\n STRING_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename, ' ~~~~ ') files,\n STRING_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id, ' ~~~~ ') hashes,\n STRING_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' '), ' ~~~~ ') dependencies\n FROM versions v\n LEFT OUTER JOIN game_versions_versions gvv on v.id = gvv.joining_version_id\n LEFT OUTER JOIN game_versions gv on gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv on v.id = lv.version_id\n LEFT OUTER JOIN loaders l on lv.loader_id = l.id\n LEFT OUTER JOIN files f on v.id = f.version_id\n LEFT OUTER JOIN hashes h on f.id = h.file_id\n LEFT OUTER JOIN dependencies d on v.id = d.dependent_id\n WHERE v.id = ANY($1)\n GROUP BY v.id\n ORDER BY v.date_published ASC;\n ", - "describe": { - "columns": [ - { "ordinal": 0, - "name": "id", "type_info": "Int8" }, { - "ordinal": 1, "name": "mod_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "author_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "version_name", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "version_number", + "ordinal": 4, "type_info": "Varchar" }, { - "ordinal": 5, "name": "changelog", + "ordinal": 5, "type_info": "Varchar" }, { - "ordinal": 6, "name": "changelog_url", + "ordinal": 6, "type_info": "Varchar" }, { - "ordinal": 7, "name": "date_published", + "ordinal": 7, "type_info": "Timestamptz" }, { - "ordinal": 8, "name": "downloads", + "ordinal": 8, "type_info": "Int4" }, { - "ordinal": 9, "name": "version_type", + "ordinal": 9, "type_info": "Varchar" }, { - "ordinal": 10, "name": "featured", + "ordinal": 10, "type_info": "Bool" }, { - "ordinal": 11, "name": "game_versions", - "type_info": "Text" + "ordinal": 11, + "type_info": "TextArray" }, { - "ordinal": 12, "name": "loaders", - "type_info": "Text" + "ordinal": 12, + "type_info": "VarcharArray" }, { - "ordinal": 13, "name": "files", - "type_info": "Text" + "ordinal": 13, + "type_info": "TextArray" }, { - "ordinal": 14, "name": "hashes", - "type_info": "Text" + "ordinal": 14, + "type_info": "TextArray" }, { - "ordinal": 15, "name": "dependencies", - "type_info": "Text" + "ordinal": 15, + "type_info": "TextArray" } ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, "nullable": [ false, false, @@ -3732,486 +3591,224 @@ null, null, null - ] - } - }, - "8f706d78ac4235ea04c59e2c220a4791e1d08fdf287b783b4aaef36fd2445467": { - "query": "\n DELETE FROM loaders\n WHERE loader = $1\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [] - } - }, - "8fd5d332e9cd2f760f956bf4936350f29df414552643bcfb352ca8a8a0b98439": { - "query": "\n UPDATE mods\n SET icon_url = $1\n WHERE (id = $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Int8" - ] - }, - "nullable": [] - } - }, - "9348309884811e8b22f33786ae7c0f259f37f3c90e545f00761a641570107160": { - "query": "\n SELECT m.title title, m.id id, pt.name project_type\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n WHERE m.team_id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 1, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "project_type", - "type_info": "Varchar" - } ], "parameters": { "Left": [ "Int8" ] - }, + } + }, + "query": "\n SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number,\n v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads,\n v.version_type version_type, v.featured featured,\n ARRAY_AGG(DISTINCT gv.version || ' |||| ' || gv.created) filter (where gv.version is not null) game_versions, ARRAY_AGG(DISTINCT l.loader) filter (where l.loader is not null) loaders,\n ARRAY_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename) filter (where f.id is not null) files,\n ARRAY_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id) filter (where h.hash is not null) hashes,\n ARRAY_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' ')) filter (where d.dependency_type is not null) dependencies\n FROM versions v\n LEFT OUTER JOIN game_versions_versions gvv on v.id = gvv.joining_version_id\n LEFT OUTER JOIN game_versions gv on gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv on v.id = lv.version_id\n LEFT OUTER JOIN loaders l on lv.loader_id = l.id\n LEFT OUTER JOIN files f on v.id = f.version_id\n LEFT OUTER JOIN hashes h on f.id = h.file_id\n LEFT OUTER JOIN dependencies d on v.id = d.dependent_id\n WHERE v.id = $1\n GROUP BY v.id;\n " + }, + "8f706d78ac4235ea04c59e2c220a4791e1d08fdf287b783b4aaef36fd2445467": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "\n DELETE FROM loaders\n WHERE loader = $1\n " + }, + "8fd5d332e9cd2f760f956bf4936350f29df414552643bcfb352ca8a8a0b98439": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Varchar", + "Int8" + ] + } + }, + "query": "\n UPDATE mods\n SET icon_url = $1\n WHERE (id = $2)\n " + }, + "9348309884811e8b22f33786ae7c0f259f37f3c90e545f00761a641570107160": { + "describe": { + "columns": [ + { + "name": "title", + "ordinal": 0, + "type_info": "Varchar" + }, + { + "name": "id", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "project_type", + "ordinal": 2, + "type_info": "Varchar" + } + ], "nullable": [ false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT m.title title, m.id id, pt.name project_type\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n WHERE m.team_id = $1\n " }, - "96587afb05c9d308d665e76dabab497b39cc7993b6fececed7dc9677d159abb3": { - "query": "\n SELECT EXISTS(SELECT 1 FROM mods WHERE slug = $1)\n ", + "9381c483b29d364f14c46d5e73bc14b1ec5d0525e27b9e9b099cb0786934fe78": { "describe": { "columns": [ { + "name": "id", "ordinal": 0, - "name": "exists", - "type_info": "Bool" + "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "\n SELECT id FROM mods\n WHERE slug = LOWER($1)\n " }, "97690dda7edea8c985891cae5ad405f628ed81e333bc88df5493c928a4324d43": { - "query": "SELECT EXISTS(SELECT 1 FROM reports WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM reports WHERE id=$1)" }, "99a1eac69d7f5a5139703df431e6a5c3012a90143a8c635f93632f04d0bc41d4": { - "query": "\n UPDATE mods\n SET wiki_url = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET wiki_url = $1\n WHERE (id = $2)\n " }, "9b231e09e8a1e56cca49bf82f9a605e3d13b9e6a1cfc6357b5f544d3d9a89dfd": { - "query": "\n SELECT f.url url, h.hash hash, h.algorithm algorithm, f.version_id version_id, v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = ANY($1::bytea[]) AND s.status != $3\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "url", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "hash", + "ordinal": 1, "type_info": "Bytea" }, { - "ordinal": 2, "name": "algorithm", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "version_id", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "project_id", + "ordinal": 4, "type_info": "Int8" } ], + "nullable": [ + false, + false, + false, + false, + false + ], "parameters": { "Left": [ "ByteaArray", "Text", "Text" ] - }, - "nullable": [ - false, - false, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT f.url url, h.hash hash, h.algorithm algorithm, f.version_id version_id, v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n INNER JOIN mods m on v.mod_id = m.id\n INNER JOIN statuses s on m.status = s.id\n WHERE h.algorithm = $2 AND h.hash = ANY($1::bytea[]) AND s.status != $3\n " }, "9ceca63fb11f35f09f77bb9db175a1ac74dfcc2200c8134866922742fbbedea3": { - "query": "\n UPDATE dependencies\n SET dependency_id = $2\n WHERE dependency_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8" ] - }, - "nullable": [] - } - }, - "a007ddf78c7bcbac5e511d15d0f130ecb5527fefcdce02972ede5b5cd2b10630": { - "query": "\n SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number,\n v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads,\n v.version_type version_type, v.featured featured,\n STRING_AGG(DISTINCT gv.version || ' |||| ' || gv.created, ' ~~~~ ') game_versions, STRING_AGG(DISTINCT l.loader, ' ~~~~ ') loaders,\n STRING_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename, ' ~~~~ ') files,\n STRING_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id, ' ~~~~ ') hashes,\n STRING_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' '), ' ~~~~ ') dependencies\n FROM versions v\n LEFT OUTER JOIN game_versions_versions gvv on v.id = gvv.joining_version_id\n LEFT OUTER JOIN game_versions gv on gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv on v.id = lv.version_id\n LEFT OUTER JOIN loaders l on lv.loader_id = l.id\n LEFT OUTER JOIN files f on v.id = f.version_id\n LEFT OUTER JOIN hashes h on f.id = h.file_id\n LEFT OUTER JOIN dependencies d on v.id = d.dependent_id\n WHERE v.id = $1\n GROUP BY v.id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "mod_id", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "author_id", - "type_info": "Int8" - }, - { - "ordinal": 3, - "name": "version_name", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "version_number", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "changelog", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "changelog_url", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "date_published", - "type_info": "Timestamptz" - }, - { - "ordinal": 8, - "name": "downloads", - "type_info": "Int4" - }, - { - "ordinal": 9, - "name": "version_type", - "type_info": "Varchar" - }, - { - "ordinal": 10, - "name": "featured", - "type_info": "Bool" - }, - { - "ordinal": 11, - "name": "game_versions", - "type_info": "Text" - }, - { - "ordinal": 12, - "name": "loaders", - "type_info": "Text" - }, - { - "ordinal": 13, - "name": "files", - "type_info": "Text" - }, - { - "ordinal": 14, - "name": "hashes", - "type_info": "Text" - }, - { - "ordinal": 15, - "name": "dependencies", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - null, - null, - null, - null, - null - ] - } + } + }, + "query": "\n UPDATE dependencies\n SET dependency_id = $2\n WHERE dependency_id = $1\n " }, "a39ce28b656032f862b205cffa393a76b989f4803654a615477a94fda5f57354": { - "query": "\n DELETE FROM states\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM states\n WHERE id = $1\n " }, "a40e4075ba1bff5b6fde104ed1557ad8d4a75d7d90d481decd222f31685c4981": { - "query": "\n DELETE FROM dependencies WHERE dependent_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM dependencies WHERE dependent_id = $1\n " }, "a647c282a276b63f36d2d8a253c32d0f627cea9cab8eb1b32b39875536bdfcbb": { - "query": "\n DELETE FROM mods_categories\n WHERE joining_mod_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } - }, - "a7a5fd1dfa3da7f476525f0b404dd0d609483154e0e91c781319f5c596b87b9e": { - "query": "\n SELECT id, project_type, title, description, downloads, follows,\n icon_url, body, body_url, published,\n updated, status,\n issues_url, source_url, wiki_url, discord_url, license_url,\n team_id, client_side, server_side, license, slug,\n moderation_message, moderation_message_body\n FROM mods\n WHERE id = ANY($1)\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "project_type", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "description", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "downloads", - "type_info": "Int4" - }, - { - "ordinal": 5, - "name": "follows", - "type_info": "Int4" - }, - { - "ordinal": 6, - "name": "icon_url", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "body", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "body_url", - "type_info": "Varchar" - }, - { - "ordinal": 9, - "name": "published", - "type_info": "Timestamptz" - }, - { - "ordinal": 10, - "name": "updated", - "type_info": "Timestamptz" - }, - { - "ordinal": 11, - "name": "status", - "type_info": "Int4" - }, - { - "ordinal": 12, - "name": "issues_url", - "type_info": "Varchar" - }, - { - "ordinal": 13, - "name": "source_url", - "type_info": "Varchar" - }, - { - "ordinal": 14, - "name": "wiki_url", - "type_info": "Varchar" - }, - { - "ordinal": 15, - "name": "discord_url", - "type_info": "Varchar" - }, - { - "ordinal": 16, - "name": "license_url", - "type_info": "Varchar" - }, - { - "ordinal": 17, - "name": "team_id", - "type_info": "Int8" - }, - { - "ordinal": 18, - "name": "client_side", - "type_info": "Int4" - }, - { - "ordinal": 19, - "name": "server_side", - "type_info": "Int4" - }, - { - "ordinal": 20, - "name": "license", - "type_info": "Int4" - }, - { - "ordinal": 21, - "name": "slug", - "type_info": "Varchar" - }, - { - "ordinal": 22, - "name": "moderation_message", - "type_info": "Varchar" - }, - { - "ordinal": 23, - "name": "moderation_message_body", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - true, - false, - true, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true - ] - } + } + }, + "query": "\n DELETE FROM mods_categories\n WHERE joining_mod_id = $1\n " }, "a82ece911fac855366bd25f1379778a803e61ab87da096f0ab9f6db3eaa521d4": { - "query": "\n INSERT INTO files (id, version_id, url, filename, is_primary, size)\n VALUES ($1, $2, $3, $4, $5, $6)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -4221,147 +3818,141 @@ "Bool", "Int4" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO files (id, version_id, url, filename, is_primary, size)\n VALUES ($1, $2, $3, $4, $5, $6)\n " }, "a8f22bd234488500b06855c8258e1e290696adba0766b46640bf87d91b150518": { - "query": "\n SELECT f.url url, f.id id, f.version_id version_id, v.mod_id mod_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n WHERE h.algorithm = $2 AND h.hash = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "url", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "version_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "mod_id", + "ordinal": 3, "type_info": "Int8" } ], + "nullable": [ + false, + false, + false, + false + ], "parameters": { "Left": [ "Bytea", "Text" ] - }, - "nullable": [ - false, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT f.url url, f.id id, f.version_id version_id, v.mod_id mod_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n WHERE h.algorithm = $2 AND h.hash = $1\n " }, "a90bb6904e1b790c0e29e060dac5ba4c2a6087e07c1197dc1f59f0aff31944c9": { - "query": "\n DELETE FROM states\n WHERE expires < CURRENT_DATE\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM states\n WHERE expires < CURRENT_DATE\n " }, "a91fabe9e620bd700362c68631628725419183025c9699f4bd31c22b813b2824": { - "query": "\n SELECT files.id, files.url, files.filename, files.is_primary FROM files\n WHERE files.version_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "url", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "filename", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "is_primary", + "ordinal": 3, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, false, false, false - ] - } - }, - "a94eb4862ba30ca21f15198d9b7b9fd80ce01d45457e0b4d68270b5e3f9be8c6": { - "query": "\n SELECT u.github_id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role\n FROM users u\n WHERE u.id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "github_id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "name", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "email", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "avatar_url", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "username", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "bio", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "created", - "type_info": "Timestamptz" - }, - { - "ordinal": 7, - "name": "role", - "type_info": "Varchar" - } ], "parameters": { "Left": [ "Int8" ] - }, + } + }, + "query": "\n SELECT files.id, files.url, files.filename, files.is_primary FROM files\n WHERE files.version_id = $1\n " + }, + "a94eb4862ba30ca21f15198d9b7b9fd80ce01d45457e0b4d68270b5e3f9be8c6": { + "describe": { + "columns": [ + { + "name": "github_id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "name", + "ordinal": 1, + "type_info": "Varchar" + }, + { + "name": "email", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "avatar_url", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "username", + "ordinal": 4, + "type_info": "Varchar" + }, + { + "name": "bio", + "ordinal": 5, + "type_info": "Varchar" + }, + { + "name": "created", + "ordinal": 6, + "type_info": "Timestamptz" + }, + { + "name": "role", + "ordinal": 7, + "type_info": "Varchar" + } + ], "nullable": [ true, true, @@ -4371,142 +3962,148 @@ true, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT u.github_id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role\n FROM users u\n WHERE u.id = $1\n " }, "aaec67a66b58dec36339c14000b319aed1b0ebb1324fc85e34d14c6430c26657": { - "query": "\n SELECT id FROM categories\n WHERE category = $1 AND project_type = $2\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text", "Int4" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM categories\n WHERE category = $1 AND project_type = $2\n " }, "ac2d17b7d7147b14f072c15ffa214c14f32f27ffa6a3c2b2a5f80f3ad49ca5e9": { - "query": "\n SELECT id FROM users\n WHERE LOWER(username) = LOWER($1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM users\n WHERE LOWER(username) = LOWER($1)\n " }, "ac840a3ba466cfa1f914a1e44fcc9052bd1e0e908140e7147d1ff72d1794cfbf": { - "query": "\n SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ null - ] - } - }, - "acbafe265c4b7a1c95b0494a0a03c8bd2cd778ae561ef5a662fa931ca26cf603": { - "query": "\n DELETE FROM mods_donations\n WHERE joining_mod_id = $1\n ", - "describe": { - "columns": [], + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)\n " + }, + "acbafe265c4b7a1c95b0494a0a03c8bd2cd778ae561ef5a662fa931ca26cf603": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n DELETE FROM mods_donations\n WHERE joining_mod_id = $1\n " }, "ad5bb49aacf1699e276fca9900d80b588c3e62b5ae872cd665222e9e9972588b": { - "query": "\n SELECT loader_id id FROM loaders_versions\n WHERE version_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false - ] - } - }, - "adbe17a5ad3cea333b30b5d6111aff713a8f7dc79ded21f5ba942c4f1108aa8f": { - "query": "\n SELECT m.title title, pt.name project_type\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n WHERE m.id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "title", - "type_info": "Varchar" - }, - { - "ordinal": 1, - "name": "project_type", - "type_info": "Varchar" - } ], "parameters": { "Left": [ "Int8" ] - }, + } + }, + "query": "\n SELECT loader_id id FROM loaders_versions\n WHERE version_id = $1\n " + }, + "adbe17a5ad3cea333b30b5d6111aff713a8f7dc79ded21f5ba942c4f1108aa8f": { + "describe": { + "columns": [ + { + "name": "title", + "ordinal": 0, + "type_info": "Varchar" + }, + { + "name": "project_type", + "ordinal": 1, + "type_info": "Varchar" + } + ], "nullable": [ false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT m.title title, pt.name project_type\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n WHERE m.id = $1\n " }, "ae1686b8b566dd7ecc57c653c9313a4b324a2ec3a63aa6a44ed1d8ea7999b115": { - "query": "\n DELETE FROM dependencies WHERE mod_dependency_id = NULL AND dependency_id = NULL AND dependency_file_name = NULL\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM dependencies WHERE mod_dependency_id = NULL AND dependency_id = NULL AND dependency_file_name = NULL\n " }, "b030a9e0fdb75eee8ee50aafdcb6063a073e2aa53cc70d40ed46437c1d0dfe80": { - "query": "\n INSERT INTO mods_gallery (\n mod_id, image_url, featured, title, description\n )\n VALUES (\n $1, $2, $3, $4, $5\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -4515,582 +4112,451 @@ "Varchar", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO mods_gallery (\n mod_id, image_url, featured, title, description\n )\n VALUES (\n $1, $2, $3, $4, $5\n )\n " }, "b0e3d1c70b87bb54819e3fac04b684a9b857aeedb4dcb7cb400c2af0dbb12922": { - "query": "\n DELETE FROM teams\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM teams\n WHERE id = $1\n " }, "b69a6f42965b3e7103fcbf46e39528466926789ff31e9ed2591bb175527ec169": { - "query": "\n DELETE FROM users\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM users\n WHERE id = $1\n " }, "b7b2b5b99340c7601de53cc33dc56af054b50b2fe4d1d212901c958115a42baa": { - "query": "\n UPDATE versions\n SET author_id = $1\n WHERE (author_id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE versions\n SET author_id = $1\n WHERE (author_id = $2)\n " }, "b8091122d243912e628b06e244bb8ac47cd36903185a50d15ad2368b257ab0e2": { - "query": "\n DELETE FROM notifications\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM notifications\n WHERE id = $1\n " }, "b903ac4e686ef85ba28d698c668da07860e7f276b261d8f2cebb74e73b094970": { - "query": "\n DELETE FROM hashes\n WHERE EXISTS(\n SELECT 1 FROM files WHERE\n (files.version_id = $1) AND\n (hashes.file_id = files.id)\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM hashes\n WHERE EXISTS(\n SELECT 1 FROM files WHERE\n (files.version_id = $1) AND\n (hashes.file_id = files.id)\n )\n " }, "b9399840dbbf807a03d69b7fcb3bd479ef20920ab1e3c91706a1c2c7089f48e7": { - "query": "\n INSERT INTO teams (id)\n VALUES ($1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO teams (id)\n VALUES ($1)\n " }, "b96ab39ab9624bfcdc8675107544307af9892504c4cbc40e4e7c40a1e4e83e14": { - "query": "\n INSERT INTO game_versions_versions (game_version_id, joining_version_id)\n VALUES ($1, $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO game_versions_versions (game_version_id, joining_version_id)\n VALUES ($1, $2)\n " }, "b99e906aa6ca18b9f3f111eae7bf0d360f42385ca99228a844387bf9456a6a31": { - "query": "\n DELETE FROM reports WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM reports WHERE id = $1\n " }, "ba2e730788fb7441a7f01f414eb79b6e73046af4123ac1756442eeb1a4f0f869": { - "query": "\n DELETE FROM notifications_actions\n WHERE notification_id = ANY($1)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8Array" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM notifications_actions\n WHERE notification_id = ANY($1)\n " }, "bbfb47ae2c972734785df6b7c3e62077dc544ef4ccf8bb89e9c22c2f50a933c1": { - "query": "\n DELETE FROM report_types\n WHERE name = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM report_types\n WHERE name = $1\n " }, "bc605f80a615c7d0ca9c8207f8b0c5dc1b8f2ad0f9b3346a00078d59e5e3e253": { - "query": "\n INSERT INTO loaders (loader, icon)\n VALUES ($1, $2)\n ON CONFLICT (loader) DO NOTHING\n RETURNING id\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Varchar", "Varchar" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n INSERT INTO loaders (loader, icon)\n VALUES ($1, $2)\n ON CONFLICT (loader) DO NOTHING\n RETURNING id\n " }, "bc91841f9672608a28bd45a862919f2bd34fac0b3479e3b4b67a9f6bea2a562a": { - "query": "\n UPDATE mods\n SET issues_url = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET issues_url = $1\n WHERE (id = $2)\n " }, "bd0d1da185dc7d21ccbbfde86fc093ce9eda7dd7e07f7a53882d427010fd58ca": { - "query": "\n DELETE FROM dependencies WHERE dependent_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM dependencies WHERE dependent_id = $1\n " }, "bdaab7da16d07169c29d96330fcc17ef2fb87fdfbadca23b7289c64420ac3a04": { - "query": "\n SELECT id, user_id, role, permissions, accepted\n FROM team_members\n WHERE (team_id = $1 AND user_id = $2)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "user_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "role", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "permissions", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "accepted", + "ordinal": 4, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, "nullable": [ false, false, false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + } + }, + "query": "\n SELECT id, user_id, role, permissions, accepted\n FROM team_members\n WHERE (team_id = $1 AND user_id = $2)\n " }, "bdde6a7e476933c109c5b0d7236e033ccb7bf242266f77815a387a370365a10e": { - "query": "\n DELETE FROM notifications_actions\n WHERE notification_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM notifications_actions\n WHERE notification_id = $1\n " }, "bec1612d4929d143bc5d6860a57cc036c5ab23e69d750ca5791c620297953c50": { - "query": "\n SELECT team_id FROM mods WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "team_id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT team_id FROM mods WHERE id = $1\n " }, "bee1abe8313d17a56d93b06a31240e338c3973bc7a7374799ced3df5e38d3134": { - "query": "\n DELETE FROM game_versions_versions gvv\n WHERE gvv.joining_version_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM game_versions_versions gvv\n WHERE gvv.joining_version_id = $1\n " }, - "bf7f721664f5e0ed41adc41b5483037256635f28ff6c4e5d3cbcec4387f9c8ef": { - "query": "SELECT EXISTS(SELECT 1 FROM users WHERE id=$1)", + "bee5860ccac3c22e1ce328cc4278c6f1586d45c1804332dc3a3e90c558bca144": { "describe": { "columns": [ { - "ordinal": 0, - "name": "exists", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - null - ] - } - }, - "c100a3be0e1b7bf449576c4052d87494979cb89d194805a5ce9e928eef796ae9": { - "query": "\n UPDATE mods\n SET license_url = $1\n WHERE (id = $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Int8" - ] - }, - "nullable": [] - } - }, - "c1a3f6dcef6110d6ea884670fb82bac14b98e922bb5673c048ccce7b7300539b": { - "query": "\n SELECT EXISTS(SELECT 1 FROM reports WHERE id = $1)\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "exists", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - null - ] - } - }, - "c1fddbf97350871b79cb0c235b1f7488c6616b7c1dfbde76a712fd57e91ba158": { - "query": "\n SELECT id FROM game_versions\n WHERE version = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, "name": "id", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false - ] - } - }, - "c201a7a7198fe2a083fc556b408b8b700e81759f4aa5966a4a3874a46aafb6b2": { - "query": "\n DELETE FROM mod_follows\n WHERE follower_id = $1\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - } - }, - "c2564faa5f5a7d8aa485f4becde16ebf54d16f2dc41a70471e3b4fc896f11fd1": { - "query": "\n UPDATE versions\n SET version_type = $1\n WHERE (id = $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Int8" - ] - }, - "nullable": [] - } - }, - "c265db2e2cc1ba34ca1f30a9401018eb7760c8f0bafb1e3a7576e62bc9d3f83a": { - "query": "SELECT id, mod_id FROM versions\n WHERE (version_number = $1 AND mod_id = $2)", - "describe": { - "columns": [ - { "ordinal": 0, - "name": "id", "type_info": "Int8" }, { + "name": "project_type", "ordinal": 1, - "name": "mod_id", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text", - "Int8" - ] - }, - "nullable": [ - false, - false - ] - } - }, - "c3dcb5a8b798ea6c0922698a007dbc8ab549f5f85bad780da59163f4d6371238": { - "query": "\n SELECT id FROM mods\n WHERE status = (\n SELECT id FROM statuses WHERE status = $1\n )\n ORDER BY updated ASC\n LIMIT $2;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text", - "Int8" - ] - }, - "nullable": [ - false - ] - } - }, - "c3f594d8d0ffcf5df1b36759cf3088bfaec496c5dfdbf496d3b05f0b122a5d0c": { - "query": "\n INSERT INTO reports (\n id, report_type_id, mod_id, version_id, user_id,\n body, reporter\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7\n )\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int8", - "Int8", - "Int8", - "Varchar", - "Int8" - ] - }, - "nullable": [] - } - }, - "c545a74e902c5c63bca1057b76e94b9547ee21fadbc61964f45837915d5f4608": { - "query": "\n INSERT INTO mods_donations (\n joining_mod_id, joining_platform_id, url\n )\n VALUES (\n $1, $2, $3\n )\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Varchar" - ] - }, - "nullable": [] - } - }, - "c55d2132e3e6e92dd50457affab758623dca175dc27a2d3cd4aace9cfdecf789": { - "query": "\n INSERT INTO mod_follows (follower_id, mod_id)\n VALUES ($1, $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, - "nullable": [] - } - }, - "c5d44333c62223bd3e68185d1fb3f95152fafec593da8d06c9b2b665218a02be": { - "query": "\n UPDATE mods\n SET client_side = $1\n WHERE (id = $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Int8" - ] - }, - "nullable": [] - } - }, - "c64c487b56a25b252ff070fe03a7416e84260df8a6f938a018cc768598e9435b": { - "query": "\n SELECT category FROM categories\n WHERE id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "category", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Int4" - ] - }, - "nullable": [ - false - ] - } - }, - "c7bbfdef1c45f91debdbf8e7d377eae647152d74e4f2e70a344349e21752a34e": { - "query": "\n SELECT l.id id, l.loader loader, l.icon icon,\n ARRAY_AGG(DISTINCT pt.name) project_types\n FROM loaders l\n LEFT OUTER JOIN loaders_project_types lpt ON joining_loader_id = l.id\n LEFT OUTER JOIN project_types pt ON lpt.joining_project_type_id = pt.id\n GROUP BY l.id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", "type_info": "Int4" }, { - "ordinal": 1, - "name": "loader", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "icon", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "project_types", - "type_info": "VarcharArray" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - null - ] - } - }, - "c83cef31a25dd3037fa6049da572301e3e85871dcc3a1de8acb395d34fa0cf74": { - "query": "\n SELECT n.id, n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type,\n STRING_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method, ' ~~~~ ') actions\n FROM notifications n\n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id\n WHERE n.user_id = $1\n GROUP BY n.id, n.user_id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "user_id", - "type_info": "Int8" - }, - { - "ordinal": 2, "name": "title", + "ordinal": 2, "type_info": "Varchar" }, { + "name": "description", "ordinal": 3, - "name": "text", "type_info": "Varchar" }, { + "name": "downloads", "ordinal": 4, - "name": "link", + "type_info": "Int4" + }, + { + "name": "follows", + "ordinal": 5, + "type_info": "Int4" + }, + { + "name": "icon_url", + "ordinal": 6, "type_info": "Varchar" }, { - "ordinal": 5, - "name": "created", + "name": "body", + "ordinal": 7, + "type_info": "Varchar" + }, + { + "name": "body_url", + "ordinal": 8, + "type_info": "Varchar" + }, + { + "name": "published", + "ordinal": 9, "type_info": "Timestamptz" }, { - "ordinal": 6, - "name": "read", - "type_info": "Bool" + "name": "updated", + "ordinal": 10, + "type_info": "Timestamptz" }, { - "ordinal": 7, - "name": "notification_type", + "name": "approved", + "ordinal": 11, + "type_info": "Timestamptz" + }, + { + "name": "status", + "ordinal": 12, + "type_info": "Int4" + }, + { + "name": "issues_url", + "ordinal": 13, "type_info": "Varchar" }, { - "ordinal": 8, - "name": "actions", - "type_info": "Text" + "name": "source_url", + "ordinal": 14, + "type_info": "Varchar" + }, + { + "name": "wiki_url", + "ordinal": 15, + "type_info": "Varchar" + }, + { + "name": "discord_url", + "ordinal": 16, + "type_info": "Varchar" + }, + { + "name": "license_url", + "ordinal": 17, + "type_info": "Varchar" + }, + { + "name": "team_id", + "ordinal": 18, + "type_info": "Int8" + }, + { + "name": "client_side", + "ordinal": 19, + "type_info": "Int4" + }, + { + "name": "server_side", + "ordinal": 20, + "type_info": "Int4" + }, + { + "name": "license", + "ordinal": 21, + "type_info": "Int4" + }, + { + "name": "slug", + "ordinal": 22, + "type_info": "Varchar" + }, + { + "name": "moderation_message", + "ordinal": 23, + "type_info": "Varchar" + }, + { + "name": "moderation_message_body", + "ordinal": 24, + "type_info": "Varchar" + }, + { + "name": "status_name", + "ordinal": 25, + "type_info": "Varchar" + }, + { + "name": "client_side_type", + "ordinal": 26, + "type_info": "Varchar" + }, + { + "name": "server_side_type", + "ordinal": 27, + "type_info": "Varchar" + }, + { + "name": "short", + "ordinal": 28, + "type_info": "Varchar" + }, + { + "name": "license_name", + "ordinal": 29, + "type_info": "Varchar" + }, + { + "name": "project_type_name", + "ordinal": 30, + "type_info": "Varchar" + }, + { + "name": "categories", + "ordinal": 31, + "type_info": "VarcharArray" + }, + { + "name": "additional_categories", + "ordinal": 32, + "type_info": "VarcharArray" + }, + { + "name": "versions", + "ordinal": 33, + "type_info": "TextArray" + }, + { + "name": "gallery", + "ordinal": 34, + "type_info": "TextArray" + }, + { + "name": "donations", + "ordinal": 35, + "type_info": "TextArray" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, false, @@ -5098,341 +4564,578 @@ false, false, false, - false, true, + false, + true, + false, + false, + true, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + null, + null, + null, + null, null - ] - } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + } + }, + "query": "\n SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,\n m.icon_url icon_url, m.body body, m.body_url body_url, m.published published,\n m.updated updated, m.approved approved, m.status status,\n m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url,\n m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body,\n s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, l.name license_name, pt.name project_type_name,\n ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories,\n ARRAY_AGG(DISTINCT ca.category) filter (where ca.category is not null) additional_categories,\n ARRAY_AGG(DISTINCT v.id || ' |||| ' || v.date_published) filter (where v.id is not null) versions,\n ARRAY_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' ')) filter (where mg.image_url is not null) gallery,\n ARRAY_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url) filter (where md.joining_platform_id is not null) donations\n FROM mods m\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN statuses s ON s.id = m.status\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN licenses l ON m.license = l.id\n LEFT JOIN mods_donations md ON md.joining_mod_id = m.id\n LEFT JOIN donation_platforms dp ON md.joining_platform_id = dp.id\n LEFT JOIN mods_categories mc ON mc.joining_mod_id = m.id\n LEFT JOIN categories c ON mc.joining_category_id = c.id AND mc.is_additional = FALSE\n LEFT JOIN categories ca ON mc.joining_category_id = c.id AND mc.is_additional = TRUE\n LEFT JOIN versions v ON v.mod_id = m.id\n LEFT JOIN mods_gallery mg ON mg.mod_id = m.id\n WHERE m.id = ANY($1)\n GROUP BY pt.id, s.id, cs.id, ss.id, l.id, m.id;\n " }, - "c9d63ed46799db7c30a7e917d97a5d4b2b78b0234cce49e136fa57526b38c1ca": { - "query": "\n SELECT EXISTS(SELECT 1 FROM versions WHERE id = $1)\n ", + "bf7f721664f5e0ed41adc41b5483037256635f28ff6c4e5d3cbcec4387f9c8ef": { "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM users WHERE id=$1)" }, - "ca52197b89fcc61f131b0937d642133ae19903d183f84513601e16ee7f3df7d8": { - "query": "\n SELECT id FROM mods\n WHERE LOWER(slug) = LOWER($1)\n ", + "c100a3be0e1b7bf449576c4052d87494979cb89d194805a5ce9e928eef796ae9": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Varchar", + "Int8" + ] + } + }, + "query": "\n UPDATE mods\n SET license_url = $1\n WHERE (id = $2)\n " + }, + "c1a3f6dcef6110d6ea884670fb82bac14b98e922bb5673c048ccce7b7300539b": { "describe": { "columns": [ { + "name": "exists", "ordinal": 0, - "name": "id", - "type_info": "Int8" + "type_info": "Bool" } ], + "nullable": [ + null + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM reports WHERE id = $1)\n " + }, + "c1fddbf97350871b79cb0c235b1f7488c6616b7c1dfbde76a712fd57e91ba158": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + } + ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM game_versions\n WHERE version = $1\n " }, - "cb57ae673f1a7e50cc319efddb9bdc82e2251596bcf85aea52e8def343e423b8": { - "query": "\n INSERT INTO hashes (file_id, algorithm, hash)\n VALUES ($1, $2, $3)\n ", + "c201a7a7198fe2a083fc556b408b8b700e81759f4aa5966a4a3874a46aafb6b2": { "describe": { "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n DELETE FROM mod_follows\n WHERE follower_id = $1\n " + }, + "c2564faa5f5a7d8aa485f4becde16ebf54d16f2dc41a70471e3b4fc896f11fd1": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Varchar", + "Int8" + ] + } + }, + "query": "\n UPDATE versions\n SET version_type = $1\n WHERE (id = $2)\n " + }, + "c265db2e2cc1ba34ca1f30a9401018eb7760c8f0bafb1e3a7576e62bc9d3f83a": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "mod_id", + "ordinal": 1, + "type_info": "Int8" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [ + "Text", + "Int8" + ] + } + }, + "query": "SELECT id, mod_id FROM versions\n WHERE (version_number = $1 AND mod_id = $2)" + }, + "c3dcb5a8b798ea6c0922698a007dbc8ab549f5f85bad780da59163f4d6371238": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Text", + "Int8" + ] + } + }, + "query": "\n SELECT id FROM mods\n WHERE status = (\n SELECT id FROM statuses WHERE status = $1\n )\n ORDER BY updated ASC\n LIMIT $2;\n " + }, + "c3f594d8d0ffcf5df1b36759cf3088bfaec496c5dfdbf496d3b05f0b122a5d0c": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4", + "Int8", + "Int8", + "Int8", + "Varchar", + "Int8" + ] + } + }, + "query": "\n INSERT INTO reports (\n id, report_type_id, mod_id, version_id, user_id,\n body, reporter\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7\n )\n " + }, + "c545a74e902c5c63bca1057b76e94b9547ee21fadbc61964f45837915d5f4608": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4", + "Varchar" + ] + } + }, + "query": "\n INSERT INTO mods_donations (\n joining_mod_id, joining_platform_id, url\n )\n VALUES (\n $1, $2, $3\n )\n " + }, + "c55d2132e3e6e92dd50457affab758623dca175dc27a2d3cd4aace9cfdecf789": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + } + }, + "query": "\n INSERT INTO mod_follows (follower_id, mod_id)\n VALUES ($1, $2)\n " + }, + "c5d44333c62223bd3e68185d1fb3f95152fafec593da8d06c9b2b665218a02be": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int4", + "Int8" + ] + } + }, + "query": "\n UPDATE mods\n SET client_side = $1\n WHERE (id = $2)\n " + }, + "c64c487b56a25b252ff070fe03a7416e84260df8a6f938a018cc768598e9435b": { + "describe": { + "columns": [ + { + "name": "category", + "ordinal": 0, + "type_info": "Varchar" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Int4" + ] + } + }, + "query": "\n SELECT category FROM categories\n WHERE id = $1\n " + }, + "c9d63ed46799db7c30a7e917d97a5d4b2b78b0234cce49e136fa57526b38c1ca": { + "describe": { + "columns": [ + { + "name": "exists", + "ordinal": 0, + "type_info": "Bool" + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM versions WHERE id = $1)\n " + }, + "cb57ae673f1a7e50cc319efddb9bdc82e2251596bcf85aea52e8def343e423b8": { + "describe": { + "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Varchar", "Bytea" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO hashes (file_id, algorithm, hash)\n VALUES ($1, $2, $3)\n " }, "cb597bf191d1ffe14634a9e7dc5089262497862eb4ee02091ee27c7a7606417a": { - "query": "\n DELETE FROM reports\n WHERE mod_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM reports\n WHERE mod_id = $1\n " }, "ccd913bb2f3006ffe881ce2fc4ef1e721d18fe2eed6ac62627046c955129610c": { - "query": "SELECT EXISTS(SELECT 1 FROM files WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM files WHERE id=$1)" }, "ccdbb0f1206dfe7963777f0f8edd40b57b870460fed97bf547eb6bc20a1359e6": { - "query": "\n UPDATE team_members\n SET user_id = $1\n WHERE (user_id = $2 AND role = $3)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8", "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE team_members\n SET user_id = $1\n WHERE (user_id = $2 AND role = $3)\n " }, "cdd7f8f95c308d9474e214d584c03be0466214da1e157f6bc577b76dbef7df86": { - "query": "\n DELETE FROM hashes\n WHERE file_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM hashes\n WHERE file_id = $1\n " }, "cef01012769dcd499a0d16ce65ffc1e94bce362a7246b6a0a38d133afb90d3b6": { - "query": "\n UPDATE team_members\n SET role = $1\n WHERE (team_id = $2 AND user_id = $3)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE team_members\n SET role = $1\n WHERE (team_id = $2 AND user_id = $3)\n " }, "cfcc6970c0b469c4afd37bedfd386def7980f6b7006030d4783723861d0e3a38": { - "query": "\n SELECT v.id version_id, v.mod_id project_id, h.hash hash FROM hashes h\n INNER JOIN files f on h.file_id = f.id\n INNER JOIN versions v on f.version_id = v.id\n WHERE h.algorithm = 'sha1' AND h.hash = ANY($1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "version_id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "project_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "hash", + "ordinal": 2, "type_info": "Bytea" } ], + "nullable": [ + false, + false, + false + ], "parameters": { "Left": [ "ByteaArray" ] - }, - "nullable": [ - true, - true, - true - ] - } + } + }, + "query": "\n SELECT v.id version_id, v.mod_id project_id, h.hash hash FROM hashes h\n INNER JOIN files f on h.file_id = f.id\n INNER JOIN versions v on f.version_id = v.id\n WHERE h.algorithm = 'sha1' AND h.hash = ANY($1)\n " }, "d03630ab0ff37f5f0a8c088558fdc8a1955bad78bea282c40f72d15e5cf77a79": { - "query": "\n SELECT v.id id\n FROM versions v\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id AND gvv.game_version_id = ANY($2)\n INNER JOIN loaders_versions lv ON lv.version_id = v.id AND lv.loader_id = ANY($3)\n WHERE v.mod_id = $1\n ORDER BY v.date_published DESC\n LIMIT 1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8", "Int4Array", "Int4Array" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT v.id id\n FROM versions v\n INNER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id AND gvv.game_version_id = ANY($2)\n INNER JOIN loaders_versions lv ON lv.version_id = v.id AND lv.loader_id = ANY($3)\n WHERE v.mod_id = $1\n ORDER BY v.date_published DESC\n LIMIT 1\n " }, "d12bc07adb4dc8147d0ddccd72a4f23ed38cd31d7db3d36ebbe2c9b627130f0b": { - "query": "\n DELETE FROM team_members\n WHERE team_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM team_members\n WHERE team_id = $1\n " }, "d1866ecc161c3fe3fbe094289510e99b17de563957e1f824c347c1e6ac40c40c": { - "query": "\n SELECT loader FROM loaders\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "loader", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT loader FROM loaders\n WHERE id = $1\n " }, "d2bba2670ef992df166a5e1e4d90f14f1d6b19c5fe77eb7139a5e1a0e660f6db": { - "query": "\n SELECT tm.id id, tm.role member_role, tm.permissions permissions, tm.accepted accepted,\n u.id user_id, u.github_id github_id, u.name user_name, u.email email,\n u.avatar_url avatar_url, u.username username, u.bio bio,\n u.created created, u.role user_role\n FROM team_members tm\n INNER JOIN users u ON u.id = tm.user_id\n WHERE tm.team_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "member_role", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "permissions", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "accepted", + "ordinal": 3, "type_info": "Bool" }, { - "ordinal": 4, "name": "user_id", + "ordinal": 4, "type_info": "Int8" }, { - "ordinal": 5, "name": "github_id", + "ordinal": 5, "type_info": "Int8" }, { - "ordinal": 6, "name": "user_name", + "ordinal": 6, "type_info": "Varchar" }, { - "ordinal": 7, "name": "email", + "ordinal": 7, "type_info": "Varchar" }, { - "ordinal": 8, "name": "avatar_url", + "ordinal": 8, "type_info": "Varchar" }, { - "ordinal": 9, "name": "username", + "ordinal": 9, "type_info": "Varchar" }, { - "ordinal": 10, "name": "bio", + "ordinal": 10, "type_info": "Varchar" }, { - "ordinal": 11, "name": "created", + "ordinal": 11, "type_info": "Timestamptz" }, { - "ordinal": 12, "name": "user_role", + "ordinal": 12, "type_info": "Varchar" } ], + "nullable": [ + false, + false, + false, + false, + false, + true, + true, + true, + true, + false, + true, + false, + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false, - false, - false, - false, - false, - true, - true, - true, - true, - false, - true, - false, - false - ] - } + } + }, + "query": "\n SELECT tm.id id, tm.role member_role, tm.permissions permissions, tm.accepted accepted,\n u.id user_id, u.github_id github_id, u.name user_name, u.email email,\n u.avatar_url avatar_url, u.username username, u.bio bio,\n u.created created, u.role user_role\n FROM team_members tm\n INNER JOIN users u ON u.id = tm.user_id\n WHERE tm.team_id = $1\n " }, "d331ca8f22da418cf654985c822ce4466824beaa00dea64cde90dc651a03024b": { - "query": "\n UPDATE mods\n SET moderation_message = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET moderation_message = $1\n WHERE (id = $2)\n " }, "d3991923355b2e0ed7bbe6c85d9158754d7e7d28f5ac75ee5b4e782dbc5c38a9": { - "query": "\n UPDATE team_members\n SET accepted = TRUE\n WHERE (team_id = $1 AND user_id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE team_members\n SET accepted = TRUE\n WHERE (team_id = $1 AND user_id = $2)\n " }, "d553bb44ac600047656962bd1c44378fb32e74f0e7f07d1c26336dc80dffe78a": { "describe": { @@ -5532,71 +5235,78 @@ }, "query": "\n SELECT tm.id id, tm.team_id team_id, tm.role member_role, tm.permissions permissions, tm.accepted accepted,\n u.id user_id, u.github_id github_id, u.name user_name, u.email email,\n u.avatar_url avatar_url, u.username username, u.bio bio,\n u.created created, u.role user_role\n FROM team_members tm\n INNER JOIN users u ON u.id = tm.user_id\n WHERE tm.team_id = ANY($1)\n ORDER BY tm.team_id\n " }, + "d59a0ca4725d40232eae8bf5735787e1b76282c390d2a8d07fb34e237a0b2132": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4" + ] + } + }, + "query": "\n INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional)\n VALUES ($1, $2, TRUE)\n " + }, "d5a496a0e17c5784f98ca2067bff996b23bb0a798609c4d4928df8080e4e1758": { - "query": "\n SELECT v.id, v.mod_id, v.author_id, v.name, v.version_number,\n v.changelog, v.changelog_url, v.date_published, v.downloads,\n v.version_type, v.featured\n FROM versions v\n WHERE v.id = ANY($1)\n ORDER BY v.date_published ASC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "mod_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "author_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "name", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "version_number", + "ordinal": 4, "type_info": "Varchar" }, { - "ordinal": 5, "name": "changelog", + "ordinal": 5, "type_info": "Varchar" }, { - "ordinal": 6, "name": "changelog_url", + "ordinal": 6, "type_info": "Varchar" }, { - "ordinal": 7, "name": "date_published", + "ordinal": 7, "type_info": "Timestamptz" }, { - "ordinal": 8, "name": "downloads", + "ordinal": 8, "type_info": "Int4" }, { - "ordinal": 9, "name": "version_type", + "ordinal": 9, "type_info": "Varchar" }, { - "ordinal": 10, "name": "featured", + "ordinal": 10, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, "nullable": [ false, false, @@ -5609,168 +5319,174 @@ false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + } + }, + "query": "\n SELECT v.id, v.mod_id, v.author_id, v.name, v.version_number,\n v.changelog, v.changelog_url, v.date_published, v.downloads,\n v.version_type, v.featured\n FROM versions v\n WHERE v.id = ANY($1)\n ORDER BY v.date_published ASC\n " }, "d5b00d6237b04018822db529995f0b001cd1cabf5ca93b4aff37f12c4feb83f6": { - "query": "\n INSERT INTO donation_platforms (short, name)\n VALUES ($1, $2)\n ON CONFLICT (short) DO NOTHING\n RETURNING id\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Varchar", "Varchar" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n INSERT INTO donation_platforms (short, name)\n VALUES ($1, $2)\n ON CONFLICT (short) DO NOTHING\n RETURNING id\n " }, "d6453e50041b5521fa9e919a9162e533bb9426f8c584d98474c6ad414db715c8": { - "query": "SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)" }, "d7127fd7f257cc7779841108c75f6fd8b20f9619bef1cacd0fbaf011cf0b25b3": { - "query": "\n SELECT r.id, rt.name, r.mod_id, r.version_id, r.user_id, r.body, r.reporter, r.created\n FROM reports r\n INNER JOIN report_types rt ON rt.id = r.report_type_id\n WHERE r.id = ANY($1)\n ORDER BY r.created DESC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "name", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "mod_id", + "ordinal": 2, "type_info": "Int8" }, { - "ordinal": 3, "name": "version_id", + "ordinal": 3, "type_info": "Int8" }, { - "ordinal": 4, "name": "user_id", + "ordinal": 4, "type_info": "Int8" }, { - "ordinal": 5, "name": "body", + "ordinal": 5, "type_info": "Varchar" }, { - "ordinal": 6, "name": "reporter", + "ordinal": 6, "type_info": "Int8" }, { - "ordinal": 7, "name": "created", + "ordinal": 7, "type_info": "Timestamptz" } ], + "nullable": [ + false, + false, + true, + true, + true, + false, + false, + false + ], "parameters": { "Left": [ "Int8Array" ] - }, - "nullable": [ - false, - false, - true, - true, - true, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT r.id, rt.name, r.mod_id, r.version_id, r.user_id, r.body, r.reporter, r.created\n FROM reports r\n INNER JOIN report_types rt ON rt.id = r.report_type_id\n WHERE r.id = ANY($1)\n ORDER BY r.created DESC\n " }, "d8020ed838c032c2c287dc0f08989b3ab7156f2571bc75505e6f57b0caeef9c7": { - "query": "\n SELECT id FROM donation_platforms\n WHERE short = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM donation_platforms\n WHERE short = $1\n " }, "d8b4e7e382c77a05395124d5a6a27cccb687d0e2c31b76d49b03aa364d099d42": { - "query": "\n DELETE FROM files\n WHERE files.version_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM files\n WHERE files.version_id = $1\n " }, "d97203c84aa3818d20bb88671c3160ce701f9c40c143f9a8f2ec6239e3165d84": { - "query": "\n SELECT id FROM licenses\n WHERE short = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM licenses\n WHERE short = $1\n " }, "dc2a3a07469ce25a9749d9d1c2e7424ac6765a72e8d9dd90eb682664f7cf036f": { - "query": "\n INSERT INTO versions (\n id, mod_id, author_id, name, version_number,\n changelog, changelog_url, date_published,\n downloads, version_type, featured\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7,\n $8, $9,\n $10, $11\n )\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8", @@ -5785,285 +5501,361 @@ "Varchar", "Bool" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO versions (\n id, mod_id, author_id, name, version_number,\n changelog, changelog_url, date_published,\n downloads, version_type, featured\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7,\n $8, $9,\n $10, $11\n )\n " }, "dc6aa2e7bfd5d5004620ddd4cd6a47ecc56159e1489054e0652d56df802fb5e5": { - "query": "\n UPDATE mods\n SET body = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET body = $1\n WHERE (id = $2)\n " }, - "e29da865af4a0a110275b9756394546a3bb88bff40e18c66029651f515caed98": { - "query": "\n SELECT f.id id FROM files f\n WHERE f.version_id = $1\n ", + "e048740eee3470b822956e3d394e4a2a22aa87078e5377ba6d08d6309bbb6b1d": { "describe": { "columns": [ { + "name": "user_id", "ordinal": 0, - "name": "id", "type_info": "Int8" + }, + { + "name": "title", + "ordinal": 1, + "type_info": "Varchar" + }, + { + "name": "text", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "link", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "created", + "ordinal": 4, + "type_info": "Timestamptz" + }, + { + "name": "read", + "ordinal": 5, + "type_info": "Bool" + }, + { + "name": "notification_type", + "ordinal": 6, + "type_info": "Varchar" + }, + { + "name": "actions", + "ordinal": 7, + "type_info": "TextArray" } ], + "nullable": [ + false, + false, + false, + false, + false, + false, + true, + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type,\n ARRAY_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method) filter (where na.id is not null) actions\n FROM notifications n\n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id\n WHERE n.id = $1\n GROUP BY n.id, n.user_id;\n " }, - "e3235e872f98eb85d3eb4a2518fb9dc88049ce62362bfd02623e9b49ac2e9fed": { - "query": "\n SELECT name FROM report_types\n ", + "e04e0d7add07dc7ae16496badcadd3789be22c80a04a01fbeda3f8dfca01f4b2": { "describe": { "columns": [ { + "name": "id", "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "\n SELECT id FROM mods\n WHERE slug = LOWER($1)\n " + }, + "e29da865af4a0a110275b9756394546a3bb88bff40e18c66029651f515caed98": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT f.id id FROM files f\n WHERE f.version_id = $1\n " + }, + "e3235e872f98eb85d3eb4a2518fb9dc88049ce62362bfd02623e9b49ac2e9fed": { + "describe": { + "columns": [ + { "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], - "parameters": { - "Left": [] - }, "nullable": [ false - ] - } + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT name FROM report_types\n " }, "e35fa345b43725309b976efffbc8f9e20a62a5e90a86a82a77b55c39c168d2de": { - "query": "\n SELECT id FROM versions\n WHERE mod_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM versions\n WHERE mod_id = $1\n " }, "e3cc1fd070b97c4cc36bdb2f33080d4e0d7f3c3d81312d9d28a8c3c8213ad54b": { - "query": "\n DELETE FROM files\n WHERE files.id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM files\n WHERE files.id = $1\n " }, "e48c85a2b2e11691afae3799aa126bdd8b7338a973308bbab2760c18bb9cb0b7": { - "query": "\n UPDATE versions\n SET featured = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Bool", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE versions\n SET featured = $1\n WHERE (id = $2)\n " }, "e673006d1355fa91ba5739d7cf569eec5e1ec501f7b1dc2b431f0b1c25ac07d5": { - "query": "\n DELETE FROM game_versions\n WHERE version = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM game_versions\n WHERE version = $1\n " }, "e7d0a64a08df6783c942f2fcadd94dd45f8d96ad3d3736e52ce90f68d396cdab": { - "query": "SELECT EXISTS(SELECT 1 FROM team_members WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM team_members WHERE id=$1)" }, "e8ad94314ec2972c3102041b1bf06872c8e4c8a55156a17334a0e317fe41b784": { - "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major major FROM game_versions gv\n WHERE type = $1\n ORDER BY created DESC\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" }, { - "ordinal": 1, "name": "version_", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "type_", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "created", + "ordinal": 3, "type_info": "Timestamptz" }, { - "ordinal": 4, "name": "major", + "ordinal": 4, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Text" - ] - }, "nullable": [ false, false, false, false, false - ] - } + ], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "\n SELECT gv.id id, gv.version version_, gv.type type_, gv.created created, gv.major major FROM game_versions gv\n WHERE type = $1\n ORDER BY created DESC\n " }, "e8d4589132b094df1e7a3ca0440344fc8013c0d20b3c71a1142ccbee91fb3c70": { - "query": "SELECT EXISTS(SELECT 1 FROM teams WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM teams WHERE id=$1)" }, "e8dc09a76d69e689d4b97527755aebfc049bbb4d470627a688eb9d56f01f8bd5": { - "query": "\n SELECT name FROM project_types\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT name FROM project_types\n WHERE id = $1\n " }, "e925b15ec46f0263c7775ba1ba00ed11cfd6749fa792d4eabed73b619f230585": { - "query": "\n UPDATE mods\n SET status = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET status = $1\n WHERE (id = $2)\n " }, "ea877d50ba461eae97ba3a35c3da71e7cdb7a92de1bb877d6b5dd766aca4e4ef": { - "query": "\n SELECT u.id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role\n FROM users u\n WHERE u.github_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "name", + "ordinal": 1, "type_info": "Varchar" }, { - "ordinal": 2, "name": "email", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "avatar_url", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "username", + "ordinal": 4, "type_info": "Varchar" }, { - "ordinal": 5, "name": "bio", + "ordinal": 5, "type_info": "Varchar" }, { - "ordinal": 6, "name": "created", + "ordinal": 6, "type_info": "Timestamptz" }, { - "ordinal": 7, "name": "role", + "ordinal": 7, "type_info": "Varchar" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, true, @@ -6073,266 +5865,579 @@ true, false, false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT u.id, u.name, u.email,\n u.avatar_url, u.username, u.bio,\n u.created, u.role\n FROM users u\n WHERE u.github_id = $1\n " }, "ea92ca7efdb8ba621729ce35b2ba5bf3fd0bb1ccd23a2875509eb90c6bcfee08": { - "query": "\n SELECT version_number, version_type\n FROM versions\n WHERE mod_id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "version_number", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "version_type", + "ordinal": 1, "type_info": "Varchar" } ], - "parameters": { - "Left": [ - "Int8" - ] - }, "nullable": [ false, false - ] - } - }, - "ebef881a0dae70e990814e567ed3de9565bb29b772782bc974c953af195fd6d7": { - "query": "\n SELECT n.id FROM notifications n\n WHERE n.user_id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - } ], "parameters": { "Left": [ "Int8" ] - }, + } + }, + "query": "\n SELECT version_number, version_type\n FROM versions\n WHERE mod_id = $1\n " + }, + "ebef881a0dae70e990814e567ed3de9565bb29b772782bc974c953af195fd6d7": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + } + ], "nullable": [ false - ] - } + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT n.id FROM notifications n\n WHERE n.user_id = $1\n " }, "ed1d5d9433bc7f4a360431ecfdd9430c5e58cd6d1c623c187d8661200400b1a4": { - "query": "\n UPDATE mods\n SET moderation_message_body = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET moderation_message_body = $1\n WHERE (id = $2)\n " }, "ed3e866634135d4f4c8a513eae2856ad71212f6eec09bb4ccef1506912a3a44c": { - "query": "\n UPDATE mods\n SET follows = follows + 1\n WHERE id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE mods\n SET follows = follows + 1\n WHERE id = $1\n " }, "ed5c72e789353869837e0653914c86d5d1002a4227d022567e02f280684d71a7": { - "query": "\n DELETE FROM dependencies WHERE mod_dependency_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM dependencies WHERE mod_dependency_id = $1\n " }, "ef3d43d3424824eed67370f10cc0672581a95a169bf404022cbe3cac0415d99c": { - "query": "\n SELECT f.id id, f.version_id version_id, f.filename filename, v.version_number version_number, v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n WHERE h.algorithm = $2 AND h.hash = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "ordinal": 1, "name": "version_id", + "ordinal": 1, "type_info": "Int8" }, { - "ordinal": 2, "name": "filename", + "ordinal": 2, "type_info": "Varchar" }, { - "ordinal": 3, "name": "version_number", + "ordinal": 3, "type_info": "Varchar" }, { - "ordinal": 4, "name": "project_id", + "ordinal": 4, "type_info": "Int8" } ], + "nullable": [ + false, + false, + false, + false, + false + ], "parameters": { "Left": [ "Bytea", "Text" ] - }, - "nullable": [ - false, - false, - false, - false, - false - ] - } + } + }, + "query": "\n SELECT f.id id, f.version_id version_id, f.filename filename, v.version_number version_number, v.mod_id project_id FROM hashes h\n INNER JOIN files f ON h.file_id = f.id\n INNER JOIN versions v ON v.id = f.version_id\n WHERE h.algorithm = $2 AND h.hash = $1\n " }, "ef59f99fc0ab66ff5779d0e71c4a2134e2f26eed002ff9ea5626ea3e23518594": { - "query": "\n SELECT name FROM project_types pt\n INNER JOIN mods ON mods.project_type = pt.id\n WHERE mods.id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT name FROM project_types pt\n INNER JOIN mods ON mods.project_type = pt.id\n WHERE mods.id = $1\n " }, "f0db9d8606ccc2196a9cfafe0e7090dab42bf790f25e0469b8947fac1cf043d5": { - "query": "\n SELECT version FROM game_versions\n WHERE id = $1\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "version", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT version FROM game_versions\n WHERE id = $1\n " }, "f22e9aee090f9952cf795a3540c03b0a5036dab0b740847d05e03d4565756283": { - "query": "\n DELETE FROM team_members\n WHERE user_id = $1\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n DELETE FROM team_members\n WHERE user_id = $1\n " }, "f3a8ad4a802dde0eb9304078e0368066e7d48121dfe73a63b2911b0998840a79": { - "query": "\n SELECT id FROM users\n WHERE LOWER(username) = LOWER($1)\n ", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int8" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "\n SELECT id FROM users\n WHERE LOWER(username) = LOWER($1)\n " }, "f453b43772c4d2d9d09dc389eb95482cc75e7f0eaf9dc7ff48cf40f22f1497cc": { - "query": "\n UPDATE users\n SET bio = $1\n WHERE (id = $2)\n ", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Int8" ] - }, - "nullable": [] - } + } + }, + "query": "\n UPDATE users\n SET bio = $1\n WHERE (id = $2)\n " }, - "f8c00875a7450c74423f9913cc3500898e9fcb6aa7eb8fc2f6fd16dc560773de": { - "query": "\n SELECT short, name FROM donation_platforms\n WHERE id = $1\n ", + "f8be3053274b00ee9743e798886696062009c5f681baaf29dfc24cfbbda93742": { "describe": { "columns": [ { + "name": "exists", "ordinal": 0, + "type_info": "Bool" + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "\n SELECT EXISTS(SELECT 1 FROM mods WHERE slug = LOWER($1))\n " + }, + "f8c00875a7450c74423f9913cc3500898e9fcb6aa7eb8fc2f6fd16dc560773de": { + "describe": { + "columns": [ + { "name": "short", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "name", + "ordinal": 1, "type_info": "Varchar" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "Int4" ] - }, - "nullable": [ - false, - false - ] - } + } + }, + "query": "\n SELECT short, name FROM donation_platforms\n WHERE id = $1\n " }, "fb955ca41b95120f66c98c0b528b1db10c4be4a55e9641bb104d772e390c9bb7": { - "query": "SELECT EXISTS(SELECT 1 FROM notifications WHERE id=$1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Int8" ] - }, + } + }, + "query": "SELECT EXISTS(SELECT 1 FROM notifications WHERE id=$1)" + }, + "fcd15905507769ab7f9839d64d1be3ee3f61cd555aee57dace76f8e53e91d344": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4" + ] + } + }, + "query": "\n INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional)\n VALUES ($1, $2, TRUE)\n " + }, + "fd0bcd40aa2ac11266777e586d6438950cd869b7f73a1545af5ef484f9495a5e": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "project_type", + "ordinal": 1, + "type_info": "Int4" + }, + { + "name": "title", + "ordinal": 2, + "type_info": "Varchar" + }, + { + "name": "description", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "downloads", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "follows", + "ordinal": 5, + "type_info": "Int4" + }, + { + "name": "icon_url", + "ordinal": 6, + "type_info": "Varchar" + }, + { + "name": "body", + "ordinal": 7, + "type_info": "Varchar" + }, + { + "name": "body_url", + "ordinal": 8, + "type_info": "Varchar" + }, + { + "name": "published", + "ordinal": 9, + "type_info": "Timestamptz" + }, + { + "name": "updated", + "ordinal": 10, + "type_info": "Timestamptz" + }, + { + "name": "approved", + "ordinal": 11, + "type_info": "Timestamptz" + }, + { + "name": "status", + "ordinal": 12, + "type_info": "Int4" + }, + { + "name": "issues_url", + "ordinal": 13, + "type_info": "Varchar" + }, + { + "name": "source_url", + "ordinal": 14, + "type_info": "Varchar" + }, + { + "name": "wiki_url", + "ordinal": 15, + "type_info": "Varchar" + }, + { + "name": "discord_url", + "ordinal": 16, + "type_info": "Varchar" + }, + { + "name": "license_url", + "ordinal": 17, + "type_info": "Varchar" + }, + { + "name": "team_id", + "ordinal": 18, + "type_info": "Int8" + }, + { + "name": "client_side", + "ordinal": 19, + "type_info": "Int4" + }, + { + "name": "server_side", + "ordinal": 20, + "type_info": "Int4" + }, + { + "name": "license", + "ordinal": 21, + "type_info": "Int4" + }, + { + "name": "slug", + "ordinal": 22, + "type_info": "Varchar" + }, + { + "name": "moderation_message", + "ordinal": 23, + "type_info": "Varchar" + }, + { + "name": "moderation_message_body", + "ordinal": 24, + "type_info": "Varchar" + } + ], "nullable": [ + false, + false, + false, + false, + false, + false, + true, + false, + true, + false, + false, + true, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int8Array" + ] + } + }, + "query": "\n SELECT id, project_type, title, description, downloads, follows,\n icon_url, body, body_url, published,\n updated, approved, status,\n issues_url, source_url, wiki_url, discord_url, license_url,\n team_id, client_side, server_side, license, slug,\n moderation_message, moderation_message_body\n FROM mods\n WHERE id = ANY($1)\n " + }, + "feaaae02e9d35fbfb9f83d3b653902b58489f498c493b6b0ed73ad4e1f863468": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "mod_id", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "author_id", + "ordinal": 2, + "type_info": "Int8" + }, + { + "name": "version_name", + "ordinal": 3, + "type_info": "Varchar" + }, + { + "name": "version_number", + "ordinal": 4, + "type_info": "Varchar" + }, + { + "name": "changelog", + "ordinal": 5, + "type_info": "Varchar" + }, + { + "name": "changelog_url", + "ordinal": 6, + "type_info": "Varchar" + }, + { + "name": "date_published", + "ordinal": 7, + "type_info": "Timestamptz" + }, + { + "name": "downloads", + "ordinal": 8, + "type_info": "Int4" + }, + { + "name": "version_type", + "ordinal": 9, + "type_info": "Varchar" + }, + { + "name": "featured", + "ordinal": 10, + "type_info": "Bool" + }, + { + "name": "game_versions", + "ordinal": 11, + "type_info": "TextArray" + }, + { + "name": "loaders", + "ordinal": 12, + "type_info": "VarcharArray" + }, + { + "name": "files", + "ordinal": 13, + "type_info": "TextArray" + }, + { + "name": "hashes", + "ordinal": 14, + "type_info": "TextArray" + }, + { + "name": "dependencies", + "ordinal": 15, + "type_info": "TextArray" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + null, + null, + null, + null, null - ] - } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + } + }, + "query": "\n SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number,\n v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads,\n v.version_type version_type, v.featured featured,\n ARRAY_AGG(DISTINCT gv.version || ' |||| ' || gv.created) filter (where gv.version is not null) game_versions, ARRAY_AGG(DISTINCT l.loader) filter (where l.loader is not null) loaders,\n ARRAY_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename) filter (where f.id is not null) files,\n ARRAY_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id) filter (where h.hash is not null) hashes,\n ARRAY_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' ')) filter (where d.dependency_type is not null) dependencies\n FROM versions v\n LEFT OUTER JOIN game_versions_versions gvv on v.id = gvv.joining_version_id\n LEFT OUTER JOIN game_versions gv on gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv on v.id = lv.version_id\n LEFT OUTER JOIN loaders l on lv.loader_id = l.id\n LEFT OUTER JOIN files f on v.id = f.version_id\n LEFT OUTER JOIN hashes h on f.id = h.file_id\n LEFT OUTER JOIN dependencies d on v.id = d.dependent_id\n WHERE v.id = ANY($1)\n GROUP BY v.id\n ORDER BY v.date_published ASC;\n " } } \ No newline at end of file diff --git a/src/database/models/categories.rs b/src/database/models/categories.rs index a038be363..5c4a70170 100644 --- a/src/database/models/categories.rs +++ b/src/database/models/categories.rs @@ -1,7 +1,8 @@ use super::ids::*; use super::DatabaseError; +use chrono::DateTime; +use chrono::Utc; use futures::TryStreamExt; -use time::OffsetDateTime; pub struct ProjectType { pub id: ProjectTypeId, @@ -20,7 +21,7 @@ pub struct GameVersion { pub id: GameVersionId, pub version: String, pub version_type: String, - pub date: OffsetDateTime, + pub date: DateTime, pub major: bool, } @@ -29,6 +30,7 @@ pub struct Category { pub category: String, pub project_type: String, pub icon: String, + pub header: String, } pub struct ReportType { @@ -52,6 +54,7 @@ pub struct CategoryBuilder<'a> { pub name: Option<&'a str>, pub project_type: Option<&'a ProjectTypeId>, pub icon: Option<&'a str>, + pub header: Option<&'a str>, } impl Category { @@ -60,6 +63,7 @@ impl Category { name: None, project_type: None, icon: None, + header: None, } } @@ -145,7 +149,7 @@ impl Category { { let result = sqlx::query!( " - SELECT c.id id, c.category category, c.icon icon, pt.name project_type + SELECT c.id id, c.category category, c.icon icon, c.header header, pt.name project_type FROM categories c INNER JOIN project_types pt ON c.project_type = pt.id ORDER BY c.id @@ -158,6 +162,7 @@ impl Category { category: c.category, project_type: c.project_type, icon: c.icon, + header: c.header })) }) .try_collect::>() @@ -211,6 +216,16 @@ impl<'a> CategoryBuilder<'a> { } } + pub fn header( + self, + header: &'a str, + ) -> Result, DatabaseError> { + Ok(Self { + header: Some(header), + ..self + }) + } + pub fn project_type( self, project_type: &'a ProjectTypeId, @@ -243,13 +258,14 @@ impl<'a> CategoryBuilder<'a> { })?; let result = sqlx::query!( " - INSERT INTO categories (category, project_type, icon) - VALUES ($1, $2, $3) + INSERT INTO categories (category, project_type, icon, header) + VALUES ($1, $2, $3, $4) RETURNING id ", self.name, id as ProjectTypeId, - self.icon + self.icon, + self.header ) .fetch_one(exec) .await?; @@ -327,7 +343,7 @@ impl Loader { let result = sqlx::query!( " SELECT l.id id, l.loader loader, l.icon icon, - ARRAY_AGG(DISTINCT pt.name) project_types + ARRAY_AGG(DISTINCT pt.name) filter (where pt.name is not null) project_types FROM loaders l LEFT OUTER JOIN loaders_project_types lpt ON joining_loader_id = l.id LEFT OUTER JOIN project_types pt ON lpt.joining_project_type_id = pt.id @@ -470,7 +486,7 @@ impl<'a> LoaderBuilder<'a> { pub struct GameVersionBuilder<'a> { pub version: Option<&'a str>, pub version_type: Option<&'a str>, - pub date: Option<&'a OffsetDateTime>, + pub date: Option<&'a DateTime>, } impl GameVersion { @@ -688,10 +704,7 @@ impl<'a> GameVersionBuilder<'a> { } } - pub fn created( - self, - created: &'a OffsetDateTime, - ) -> GameVersionBuilder<'a> { + pub fn created(self, created: &'a DateTime) -> GameVersionBuilder<'a> { Self { date: Some(created), ..self @@ -719,7 +732,7 @@ impl<'a> GameVersionBuilder<'a> { ", self.version, self.version_type, - self.date.map(|x| time::PrimitiveDateTime::new(x.date(), x.time())), + self.date.map(chrono::DateTime::naive_utc), ) .fetch_one(exec) .await?; diff --git a/src/database/models/mod.rs b/src/database/models/mod.rs index f7d4d9556..0df24ced1 100644 --- a/src/database/models/mod.rs +++ b/src/database/models/mod.rs @@ -1,8 +1,8 @@ #![allow(dead_code)] // TODO: remove attr once routes are created +use chrono::{DateTime, Utc}; use thiserror::Error; -use time::OffsetDateTime; pub mod categories; pub mod ids; @@ -123,14 +123,12 @@ impl ids::ProjectTypeId { .fetch_optional(exec) .await?; - Ok(result.map(|r| ids::ProjectTypeId(r.id))) + Ok(result.map(|r| ProjectTypeId(r.id))) } } -pub fn convert_postgres_date(input: &str) -> OffsetDateTime { - OffsetDateTime::parse( - format!("{}:00Z", input.replace(' ', "T")), - time::Format::Rfc3339, - ) - .unwrap_or_else(|_| OffsetDateTime::now_utc()) +pub fn convert_postgres_date(input: &str) -> DateTime { + DateTime::parse_from_rfc3339(&*format!("{}:00Z", input.replace(' ', "T"))) + .map(|x| x.with_timezone(&Utc)) + .unwrap_or_else(|_| Utc::now()) } diff --git a/src/database/models/notification_item.rs b/src/database/models/notification_item.rs index b0b77b196..0ab53aaf0 100644 --- a/src/database/models/notification_item.rs +++ b/src/database/models/notification_item.rs @@ -1,6 +1,6 @@ use super::ids::*; use crate::database::models::DatabaseError; -use time::OffsetDateTime; +use chrono::{DateTime, Utc}; pub struct NotificationBuilder { pub notification_type: Option, @@ -23,7 +23,7 @@ pub struct Notification { pub text: String, pub link: String, pub read: bool, - pub created: OffsetDateTime, + pub created: DateTime, pub actions: Vec, } @@ -72,7 +72,7 @@ impl NotificationBuilder { text: self.text.clone(), link: self.link.clone(), read: false, - created: OffsetDateTime::now_utc(), + created: Utc::now(), actions, } .insert(&mut *transaction) @@ -124,7 +124,7 @@ impl Notification { let result = sqlx::query!( " SELECT n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type, - STRING_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method, ' ~~~~ ') actions + ARRAY_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method) filter (where na.id is not null) actions FROM notifications n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id WHERE n.id = $1 @@ -138,24 +138,21 @@ impl Notification { if let Some(row) = result { let mut actions: Vec = Vec::new(); - row.actions - .unwrap_or_default() - .split(" ~~~~ ") - .for_each(|x| { - let action: Vec<&str> = x.split(" |||| ").collect(); + row.actions.unwrap_or_default().into_iter().for_each(|x| { + let action: Vec<&str> = x.split(" |||| ").collect(); - if action.len() >= 3 { - actions.push(NotificationAction { - id: NotificationActionId( - action[0].parse().unwrap_or(0), - ), - notification_id: id, - title: action[1].to_string(), - action_route_method: action[3].to_string(), - action_route: action[2].to_string(), - }); - } - }); + if action.len() >= 3 { + actions.push(NotificationAction { + id: NotificationActionId( + action[0].parse().unwrap_or(0), + ), + notification_id: id, + title: action[1].to_string(), + action_route_method: action[3].to_string(), + action_route: action[2].to_string(), + }); + } + }); Ok(Some(Notification { id, @@ -187,7 +184,7 @@ impl Notification { sqlx::query!( " SELECT n.id, n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type, - STRING_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method, ' ~~~~ ') actions + ARRAY_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method) filter (where na.id is not null) actions FROM notifications n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id WHERE n.id = ANY($1) @@ -202,7 +199,7 @@ impl Notification { let id = NotificationId(row.id); let mut actions: Vec = Vec::new(); - row.actions.unwrap_or_default().split(" ~~~~ ").for_each(|x| { + row.actions.unwrap_or_default().into_iter().for_each(|x| { let action: Vec<&str> = x.split(" |||| ").collect(); if action.len() >= 3 { @@ -245,7 +242,7 @@ impl Notification { sqlx::query!( " SELECT n.id, n.user_id, n.title, n.text, n.link, n.created, n.read, n.type notification_type, - STRING_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method, ' ~~~~ ') actions + ARRAY_AGG(DISTINCT na.id || ' |||| ' || na.title || ' |||| ' || na.action_route || ' |||| ' || na.action_route_method) filter (where na.id is not null) actions FROM notifications n LEFT OUTER JOIN notifications_actions na on n.id = na.notification_id WHERE n.user_id = $1 @@ -259,7 +256,7 @@ impl Notification { let id = NotificationId(row.id); let mut actions: Vec = Vec::new(); - row.actions.unwrap_or_default().split(" ~~~~ ").for_each(|x| { + row.actions.unwrap_or_default().into_iter().for_each(|x| { let action: Vec<&str> = x.split(" |||| ").collect(); if action.len() >= 3 { diff --git a/src/database/models/project_item.rs b/src/database/models/project_item.rs index 0729b25aa..3e9edaf80 100644 --- a/src/database/models/project_item.rs +++ b/src/database/models/project_item.rs @@ -1,6 +1,6 @@ use super::ids::*; use crate::database::models::convert_postgres_date; -use time::OffsetDateTime; +use chrono::{DateTime, Utc}; #[derive(Clone, Debug)] pub struct DonationUrl { @@ -43,7 +43,7 @@ pub struct GalleryItem { pub featured: bool, pub title: Option, pub description: Option, - pub created: OffsetDateTime, + pub created: DateTime, } impl GalleryItem { @@ -87,6 +87,7 @@ pub struct ProjectBuilder { pub license_url: Option, pub discord_url: Option, pub categories: Vec, + pub additional_categories: Vec, pub initial_versions: Vec, pub status: StatusId, pub client_side: SideTypeId, @@ -110,8 +111,9 @@ impl ProjectBuilder { description: self.description, body: self.body, body_url: None, - published: time::OffsetDateTime::now_utc(), - updated: time::OffsetDateTime::now_utc(), + published: Utc::now(), + updated: Utc::now(), + approved: None, status: self.status, downloads: 0, follows: 0, @@ -148,8 +150,8 @@ impl ProjectBuilder { for category in self.categories { sqlx::query!( " - INSERT INTO mods_categories (joining_mod_id, joining_category_id) - VALUES ($1, $2) + INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional) + VALUES ($1, $2, FALSE) ", self.project_id as ProjectId, category as CategoryId, @@ -158,6 +160,19 @@ impl ProjectBuilder { .await?; } + for category in self.additional_categories { + sqlx::query!( + " + INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional) + VALUES ($1, $2, TRUE) + ", + self.project_id as ProjectId, + category as CategoryId, + ) + .execute(&mut *transaction) + .await?; + } + Ok(self.project_id) } } @@ -170,8 +185,9 @@ pub struct Project { pub description: String, pub body: String, pub body_url: Option, - pub published: OffsetDateTime, - pub updated: OffsetDateTime, + pub published: DateTime, + pub updated: DateTime, + pub approved: Option>, pub status: StatusId, pub downloads: i32, pub follows: i32, @@ -248,7 +264,7 @@ impl Project { " SELECT project_type, title, description, downloads, follows, icon_url, body, body_url, published, - updated, status, + updated, approved, status, issues_url, source_url, wiki_url, discord_url, license_url, team_id, client_side, server_side, license, slug, moderation_message, moderation_message_body @@ -286,6 +302,7 @@ impl Project { follows: row.follows, moderation_message: row.moderation_message, moderation_message_body: row.moderation_message_body, + approved: row.approved, })) } else { Ok(None) @@ -307,7 +324,7 @@ impl Project { " SELECT id, project_type, title, description, downloads, follows, icon_url, body, body_url, published, - updated, status, + updated, approved, status, issues_url, source_url, wiki_url, discord_url, license_url, team_id, client_side, server_side, license, slug, moderation_message, moderation_message_body @@ -343,6 +360,7 @@ impl Project { follows: m.follows, moderation_message: m.moderation_message, moderation_message_body: m.moderation_message_body, + approved: m.approved, })) }) .try_collect::>() @@ -499,7 +517,7 @@ impl Project { let id = sqlx::query!( " SELECT id FROM mods - WHERE LOWER(slug) = LOWER($1) + WHERE slug = LOWER($1) ", slug ) @@ -523,7 +541,7 @@ impl Project { let id = sqlx::query!( " SELECT id FROM mods - WHERE LOWER(slug) = LOWER($1) + WHERE slug = LOWER($1) ", slug ) @@ -607,13 +625,15 @@ impl Project { " SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows, m.icon_url icon_url, m.body body, m.body_url body_url, m.published published, - m.updated updated, m.status status, + m.updated updated, m.approved approved, m.status status, m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url, m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body, s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, l.name license_name, pt.name project_type_name, - STRING_AGG(DISTINCT c.category, ' ~~~~ ') categories, STRING_AGG(DISTINCT v.id::text, ' ~~~~ ') versions, - STRING_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' '), ' ~~~~ ') gallery, - STRING_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url, ' ~~~~ ') donations + ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories, + ARRAY_AGG(DISTINCT ca.category) filter (where ca.category is not null) additional_categories, + ARRAY_AGG(DISTINCT v.id || ' |||| ' || v.date_published) filter (where v.id is not null) versions, + ARRAY_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' ')) filter (where mg.image_url is not null) gallery, + ARRAY_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url) filter (where md.joining_platform_id is not null) donations FROM mods m INNER JOIN project_types pt ON pt.id = m.project_type INNER JOIN statuses s ON s.id = m.status @@ -624,6 +644,7 @@ impl Project { LEFT JOIN donation_platforms dp ON md.joining_platform_id = dp.id LEFT JOIN mods_categories mc ON mc.joining_mod_id = m.id LEFT JOIN categories c ON mc.joining_category_id = c.id + LEFT JOIN categories ca ON mc.joining_category_id = c.id AND mc.is_additional = TRUE LEFT JOIN versions v ON v.mod_id = m.id LEFT JOIN mods_gallery mg ON mg.mod_id = m.id WHERE m.id = $1 @@ -661,24 +682,44 @@ impl Project { follows: m.follows, moderation_message: m.moderation_message, moderation_message_body: m.moderation_message_body, + approved: m.approved, }, project_type: m.project_type_name, - categories: m - .categories - .map(|x| x.split(" ~~~~ ").map(|x| x.to_string()).collect()) - .unwrap_or_default(), - versions: m - .versions - .map(|x| { - x.split(" ~~~~ ") - .map(|x| VersionId(x.parse().unwrap_or_default())) - .collect() - }) + categories: m.categories.unwrap_or_default(), + additional_categories: m + .additional_categories .unwrap_or_default(), + versions: { + let versions = m.versions.unwrap_or_default(); + + let mut v = versions + .into_iter() + .flat_map(|x| { + let version: Vec<&str> = + x.split(" |||| ").collect(); + + if version.len() >= 2 { + Some(( + VersionId( + version[0].parse().unwrap_or_default(), + ), + convert_postgres_date(version[1]) + .timestamp(), + )) + } else { + None + } + }) + .collect::>(); + + v.sort_by(|a, b| a.1.cmp(&b.1)); + + v.into_iter().map(|x| x.0).collect() + }, donation_urls: m .donations .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|d| { let strings: Vec<&str> = d.split(" |||| ").collect(); @@ -700,7 +741,7 @@ impl Project { gallery_items: m .gallery .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|d| { let strings: Vec<&str> = d.split(" |||| ").collect(); @@ -758,13 +799,15 @@ impl Project { " SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows, m.icon_url icon_url, m.body body, m.body_url body_url, m.published published, - m.updated updated, m.status status, + m.updated updated, m.approved approved, m.status status, m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url, m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body, s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, l.name license_name, pt.name project_type_name, - STRING_AGG(DISTINCT c.category, ' ~~~~ ') categories, STRING_AGG(DISTINCT v.id::text, ' ~~~~ ') versions, - STRING_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' '), ' ~~~~ ') gallery, - STRING_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url, ' ~~~~ ') donations + ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories, + ARRAY_AGG(DISTINCT ca.category) filter (where ca.category is not null) additional_categories, + ARRAY_AGG(DISTINCT v.id || ' |||| ' || v.date_published) filter (where v.id is not null) versions, + ARRAY_AGG(DISTINCT mg.image_url || ' |||| ' || mg.featured || ' |||| ' || mg.created || ' |||| ' || COALESCE(mg.title, ' ') || ' |||| ' || COALESCE(mg.description, ' ')) filter (where mg.image_url is not null) gallery, + ARRAY_AGG(DISTINCT md.joining_platform_id || ' |||| ' || dp.short || ' |||| ' || dp.name || ' |||| ' || md.url) filter (where md.joining_platform_id is not null) donations FROM mods m INNER JOIN project_types pt ON pt.id = m.project_type INNER JOIN statuses s ON s.id = m.status @@ -774,7 +817,8 @@ impl Project { LEFT JOIN mods_donations md ON md.joining_mod_id = m.id LEFT JOIN donation_platforms dp ON md.joining_platform_id = dp.id LEFT JOIN mods_categories mc ON mc.joining_mod_id = m.id - LEFT JOIN categories c ON mc.joining_category_id = c.id + LEFT JOIN categories c ON mc.joining_category_id = c.id AND mc.is_additional = FALSE + LEFT JOIN categories ca ON mc.joining_category_id = c.id AND mc.is_additional = TRUE LEFT JOIN versions v ON v.mod_id = m.id LEFT JOIN mods_gallery mg ON mg.mod_id = m.id WHERE m.id = ANY($1) @@ -812,14 +856,40 @@ impl Project { follows: m.follows, moderation_message: m.moderation_message, moderation_message_body: m.moderation_message_body, + approved: m.approved }, project_type: m.project_type_name, - categories: m.categories.map(|x| x.split(" ~~~~ ").map(|x| x.to_string()).collect()).unwrap_or_default(), - versions: m.versions.map(|x| x.split(" ~~~~ ").map(|x| VersionId(x.parse().unwrap_or_default())).collect()).unwrap_or_default(), + categories: m.categories.unwrap_or_default(), + additional_categories: m.additional_categories.unwrap_or_default(), + versions: { + let versions = m.versions.unwrap_or_default(); + + let mut v = versions + .into_iter() + .flat_map(|x| { + let version: Vec<&str> = + x.split(" |||| ").collect(); + + if version.len() >= 2 { + Some(( + VersionId(version[0].parse().unwrap_or_default()), + convert_postgres_date(version[1]) + .timestamp(), + )) + } else { + None + } + }) + .collect::>(); + + v.sort_by(|a, b| a.1.cmp(&b.1)); + + v.into_iter().map(|x| x.0).collect() + }, gallery_items: m .gallery .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|d| { let strings: Vec<&str> = d.split(" |||| ").collect(); @@ -840,7 +910,7 @@ impl Project { donation_urls: m .donations .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|d| { let strings: Vec<&str> = d.split(" |||| ").collect(); @@ -873,6 +943,7 @@ pub struct QueryProject { pub inner: Project, pub project_type: String, pub categories: Vec, + pub additional_categories: Vec, pub versions: Vec, pub donation_urls: Vec, pub gallery_items: Vec, diff --git a/src/database/models/report_item.rs b/src/database/models/report_item.rs index 522aade97..b480e0a92 100644 --- a/src/database/models/report_item.rs +++ b/src/database/models/report_item.rs @@ -1,5 +1,5 @@ use super::ids::*; -use time::OffsetDateTime; +use chrono::{DateTime, Utc}; pub struct Report { pub id: ReportId, @@ -9,7 +9,7 @@ pub struct Report { pub user_id: Option, pub body: String, pub reporter: UserId, - pub created: OffsetDateTime, + pub created: DateTime, } pub struct QueryReport { @@ -20,7 +20,7 @@ pub struct QueryReport { pub user_id: Option, pub body: String, pub reporter: UserId, - pub created: OffsetDateTime, + pub created: DateTime, } impl Report { diff --git a/src/database/models/user_item.rs b/src/database/models/user_item.rs index 7efcbbdb1..0f1ffbca2 100644 --- a/src/database/models/user_item.rs +++ b/src/database/models/user_item.rs @@ -1,5 +1,5 @@ use super::ids::{ProjectId, UserId}; -use time::OffsetDateTime; +use chrono::{DateTime, Utc}; pub struct User { pub id: UserId, @@ -9,7 +9,7 @@ pub struct User { pub email: Option, pub avatar_url: Option, pub bio: Option, - pub created: OffsetDateTime, + pub created: DateTime, pub role: String, } diff --git a/src/database/models/version_item.rs b/src/database/models/version_item.rs index d05d55ac2..5b0a56188 100644 --- a/src/database/models/version_item.rs +++ b/src/database/models/version_item.rs @@ -1,8 +1,8 @@ use super::ids::*; use super::DatabaseError; use crate::database::models::convert_postgres_date; +use chrono::{DateTime, Utc}; use std::collections::HashMap; -use time::OffsetDateTime; pub struct VersionBuilder { pub version_id: VersionId, @@ -144,7 +144,7 @@ impl VersionBuilder { version_number: self.version_number, changelog: self.changelog, changelog_url: None, - date_published: OffsetDateTime::now_utc(), + date_published: Utc::now(), downloads: 0, featured: self.featured, version_type: self.version_type, @@ -244,7 +244,7 @@ pub struct Version { pub version_number: String, pub changelog: String, pub changelog_url: Option, - pub date_published: OffsetDateTime, + pub date_published: DateTime, pub downloads: i32, pub version_type: String, pub featured: bool, @@ -614,10 +614,10 @@ impl Version { SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number, v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads, v.version_type version_type, v.featured featured, - STRING_AGG(DISTINCT gv.version || ' |||| ' || gv.created, ' ~~~~ ') game_versions, STRING_AGG(DISTINCT l.loader, ' ~~~~ ') loaders, - STRING_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename, ' ~~~~ ') files, - STRING_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id, ' ~~~~ ') hashes, - STRING_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' '), ' ~~~~ ') dependencies + ARRAY_AGG(DISTINCT gv.version || ' |||| ' || gv.created) filter (where gv.version is not null) game_versions, ARRAY_AGG(DISTINCT l.loader) filter (where l.loader is not null) loaders, + ARRAY_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename) filter (where f.id is not null) files, + ARRAY_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id) filter (where h.hash is not null) hashes, + ARRAY_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' ')) filter (where d.dependency_type is not null) dependencies FROM versions v LEFT OUTER JOIN game_versions_versions gvv on v.id = gvv.joining_version_id LEFT OUTER JOIN game_versions gv on gvv.game_version_id = gv.id @@ -649,7 +649,7 @@ impl Version { let hashes: Vec<(FileId, String, Vec)> = v .hashes .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|f| { let hash: Vec<&str> = f.split(" |||| ").collect(); @@ -667,7 +667,7 @@ impl Version { v.files .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|f| { let file: Vec<&str> = f.split(" |||| ").collect(); @@ -703,38 +703,33 @@ impl Version { let game_versions = v.game_versions.unwrap_or_default(); let mut gv = game_versions - .split(" ~~~~ ") + .into_iter() .flat_map(|x| { let version: Vec<&str> = x.split(" |||| ").collect(); if version.len() >= 2 { Some(( - version[0], + version[0].to_string(), convert_postgres_date(version[1]) - .unix_timestamp(), + .timestamp(), )) } else { None } }) - .collect::>(); + .collect::>(); gv.sort_by(|a, b| a.1.cmp(&b.1)); - gv.into_iter().map(|x| x.0.to_string()).collect() + gv.into_iter().map(|x| x.0).collect() }, - loaders: v - .loaders - .unwrap_or_default() - .split(" ~~~~ ") - .map(|x| x.to_string()) - .collect(), + loaders: v.loaders.unwrap_or_default(), featured: v.featured, dependencies: v .dependencies .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() .flat_map(|f| { let dependency: Vec<&str> = f.split(" |||| ").collect(); @@ -789,10 +784,10 @@ impl Version { SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number, v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads, v.version_type version_type, v.featured featured, - STRING_AGG(DISTINCT gv.version || ' |||| ' || gv.created, ' ~~~~ ') game_versions, STRING_AGG(DISTINCT l.loader, ' ~~~~ ') loaders, - STRING_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename, ' ~~~~ ') files, - STRING_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id, ' ~~~~ ') hashes, - STRING_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' '), ' ~~~~ ') dependencies + ARRAY_AGG(DISTINCT gv.version || ' |||| ' || gv.created) filter (where gv.version is not null) game_versions, ARRAY_AGG(DISTINCT l.loader) filter (where l.loader is not null) loaders, + ARRAY_AGG(DISTINCT f.id || ' |||| ' || f.is_primary || ' |||| ' || f.size || ' |||| ' || f.url || ' |||| ' || f.filename) filter (where f.id is not null) files, + ARRAY_AGG(DISTINCT h.algorithm || ' |||| ' || encode(h.hash, 'escape') || ' |||| ' || h.file_id) filter (where h.hash is not null) hashes, + ARRAY_AGG(DISTINCT COALESCE(d.dependency_id, 0) || ' |||| ' || COALESCE(d.mod_dependency_id, 0) || ' |||| ' || d.dependency_type || ' |||| ' || COALESCE(d.dependency_file_name, ' ')) filter (where d.dependency_type is not null) dependencies FROM versions v LEFT OUTER JOIN game_versions_versions gvv on v.id = gvv.joining_version_id LEFT OUTER JOIN game_versions gv on gvv.game_version_id = gv.id @@ -821,7 +816,9 @@ impl Version { date_published: v.date_published, downloads: v.downloads, files: { - let hashes: Vec<(FileId, String, Vec)> = v.hashes.unwrap_or_default().split(" ~~~~ ").flat_map(|f| { + let hashes: Vec<(FileId, String, Vec)> = v.hashes.unwrap_or_default() + .into_iter() + .flat_map(|f| { let hash: Vec<&str> = f.split(" |||| ").collect(); if hash.len() >= 3 { @@ -835,7 +832,9 @@ impl Version { } }).collect(); - v.files.unwrap_or_default().split(" ~~~~ ").flat_map(|f| { + v.files.unwrap_or_default() + .into_iter() + .flat_map(|f| { let file: Vec<&str> = f.split(" |||| ").collect(); if file.len() >= 5 { @@ -867,29 +866,31 @@ impl Version { .unwrap_or_default(); let mut gv = game_versions - .split(" ~~~~ ") + .into_iter() + .flat_map(|x| { let version: Vec<&str> = x.split(" |||| ").collect(); if version.len() >= 2 { - Some((version[0], convert_postgres_date(version[1]).unix_timestamp())) + Some((version[0].to_string(), convert_postgres_date(version[1]).timestamp())) } else { None } }) - .collect::>(); + .collect::>(); gv.sort_by(|a, b| a.1.cmp(&b.1)); gv.into_iter() - .map(|x| x.0.to_string()) + .map(|x| x.0) .collect() }, - loaders: v.loaders.unwrap_or_default().split(" ~~~~ ").map(|x| x.to_string()).collect(), + loaders: v.loaders.unwrap_or_default(), featured: v.featured, dependencies: v.dependencies .unwrap_or_default() - .split(" ~~~~ ") + .into_iter() + .flat_map(|f| { let dependency: Vec<&str> = f.split(" |||| ").collect(); @@ -952,7 +953,7 @@ pub struct QueryVersion { pub version_number: String, pub changelog: String, pub changelog_url: Option, - pub date_published: OffsetDateTime, + pub date_published: DateTime, pub downloads: i32, pub version_type: String, diff --git a/src/file_hosting/mock.rs b/src/file_hosting/mock.rs index 7d4e001dd..f9ff94f85 100644 --- a/src/file_hosting/mock.rs +++ b/src/file_hosting/mock.rs @@ -1,8 +1,8 @@ use super::{DeleteFileData, FileHost, FileHostingError, UploadFileData}; use async_trait::async_trait; use bytes::Bytes; +use chrono::Utc; use sha2::Digest; -use time::OffsetDateTime; pub struct MockHost(()); @@ -39,7 +39,7 @@ impl FileHost for MockHost { content_sha1, content_md5: None, content_type: content_type.to_string(), - upload_timestamp: OffsetDateTime::now_utc().unix_timestamp() as u64, + upload_timestamp: Utc::now().timestamp() as u64, }) } diff --git a/src/file_hosting/s3_host.rs b/src/file_hosting/s3_host.rs index 11d57c8f3..e677f2610 100644 --- a/src/file_hosting/s3_host.rs +++ b/src/file_hosting/s3_host.rs @@ -3,11 +3,11 @@ use crate::file_hosting::{ }; use async_trait::async_trait; use bytes::Bytes; +use chrono::Utc; use s3::bucket::Bucket; use s3::creds::Credentials; use s3::region::Region; use sha2::Digest; -use time::OffsetDateTime; pub struct S3Host { bucket: Bucket, @@ -85,7 +85,7 @@ impl FileHost for S3Host { content_sha1, content_md5: None, content_type: content_type.to_string(), - upload_timestamp: OffsetDateTime::now_utc().unix_timestamp() as u64, + upload_timestamp: Utc::now().timestamp() as u64, }) } diff --git a/src/models/notifications.rs b/src/models/notifications.rs index 376cd9b7c..f327e3886 100644 --- a/src/models/notifications.rs +++ b/src/models/notifications.rs @@ -1,7 +1,7 @@ use super::ids::Base62Id; use super::users::UserId; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -use time::OffsetDateTime; #[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(from = "Base62Id")] @@ -18,8 +18,7 @@ pub struct Notification { pub text: String, pub link: String, pub read: bool, - #[serde(with = "crate::util::time_ser")] - pub created: OffsetDateTime, + pub created: DateTime, pub actions: Vec, } diff --git a/src/models/projects.rs b/src/models/projects.rs index cba90024f..8f1f3c538 100644 --- a/src/models/projects.rs +++ b/src/models/projects.rs @@ -3,8 +3,8 @@ use super::teams::TeamId; use super::users::UserId; use crate::database::models::project_item::QueryProject; use crate::database::models::version_item::QueryVersion; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -use time::OffsetDateTime; use validator::Validate; /// The ID of a specific project, encoded as base62 for usage in the API @@ -40,12 +40,14 @@ pub struct Project { pub body_url: Option, /// The date at which the project was first published. - #[serde(with = "crate::util::time_ser")] - pub published: OffsetDateTime, + pub published: DateTime, - #[serde(with = "crate::util::time_ser")] /// The date at which the project was first published. - pub updated: OffsetDateTime, + pub updated: DateTime, + + /// The date at which the project was first approved. + //pub approved: Option>, + pub approved: Option>, /// The status of the project pub status: ProjectStatus, @@ -67,6 +69,9 @@ pub struct Project { /// A list of the categories that the project is in. pub categories: Vec, + + /// A list of the categories that the project is in. + pub additional_categories: Vec, /// A list of ids for versions of the project. pub versions: Vec, /// The URL of the icon of the project @@ -100,6 +105,7 @@ impl From for Project { body_url: m.body_url, published: m.published, updated: m.updated, + approved: m.approved, status: data.status, moderator_message: if let Some(message) = m.moderation_message { Some(ModeratorMessage { @@ -119,6 +125,7 @@ impl From for Project { downloads: m.downloads as u32, followers: m.follows as u32, categories: data.categories, + additional_categories: data.additional_categories, versions: data.versions.into_iter().map(|v| v.into()).collect(), icon_url: m.icon_url, issues_url: m.issues_url, @@ -156,8 +163,7 @@ pub struct GalleryItem { pub featured: bool, pub title: Option, pub description: Option, - #[serde(with = "crate::util::time_ser")] - pub created: OffsetDateTime, + pub created: DateTime, } #[derive(Serialize, Deserialize, Clone, Debug)] @@ -303,9 +309,8 @@ pub struct Version { /// A link to the changelog for this version of the project. (Deprecated), being replaced by `changelog` pub changelog_url: Option, - #[serde(with = "crate::util::time_ser")] /// The date that this version was published. - pub date_published: OffsetDateTime, + pub date_published: DateTime, /// The number of downloads this specific version has had. pub downloads: u32, /// The type of the release - `Alpha`, `Beta`, or `Release`. diff --git a/src/models/reports.rs b/src/models/reports.rs index d6a76d1df..e970f3434 100644 --- a/src/models/reports.rs +++ b/src/models/reports.rs @@ -1,7 +1,7 @@ use super::ids::Base62Id; use crate::models::ids::UserId; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -use time::OffsetDateTime; #[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(from = "Base62Id")] @@ -16,8 +16,7 @@ pub struct Report { pub item_type: ItemType, pub reporter: UserId, pub body: String, - #[serde(with = "crate::util::time_ser")] - pub created: OffsetDateTime, + pub created: DateTime, } #[derive(Serialize, Deserialize, Clone)] diff --git a/src/models/users.rs b/src/models/users.rs index e5f4b3958..90a5fc6b5 100644 --- a/src/models/users.rs +++ b/src/models/users.rs @@ -1,6 +1,6 @@ use super::ids::Base62Id; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -use time::OffsetDateTime; #[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(from = "Base62Id")] @@ -18,8 +18,7 @@ pub struct User { pub email: Option, pub avatar_url: Option, pub bio: Option, - #[serde(with = "crate::util::time_ser")] - pub created: OffsetDateTime, + pub created: DateTime, pub role: Role, } diff --git a/src/routes/auth.rs b/src/routes/auth.rs index 9f90c90e2..eebb88b33 100644 --- a/src/routes/auth.rs +++ b/src/routes/auth.rs @@ -21,10 +21,10 @@ use crate::util::auth::get_github_user_from_token; use actix_web::http::StatusCode; use actix_web::web::{scope, Data, Query, ServiceConfig}; use actix_web::{get, HttpResponse}; +use chrono::Utc; use serde::{Deserialize, Serialize}; use sqlx::postgres::PgPool; use thiserror::Error; -use time::OffsetDateTime; pub fn config(cfg: &mut ServiceConfig) { cfg.service(scope("auth").service(auth_callback).service(init)); @@ -176,9 +176,9 @@ pub async fn auth_callback( .await?; if let Some(result) = result_option { - let duration = result.expires - OffsetDateTime::now_utc(); + let duration: chrono::Duration = result.expires - Utc::now(); - if duration.whole_seconds() < 0 { + if duration.num_seconds() < 0 { return Err(AuthorizationError::InvalidCredentials); } @@ -255,7 +255,7 @@ pub async fn auth_callback( email: user.email, avatar_url: Some(user.avatar_url), bio: user.bio, - created: OffsetDateTime::now_utc(), + created: Utc::now(), role: Role::Developer.to_string(), } .insert(&mut transaction) diff --git a/src/routes/maven.rs b/src/routes/maven.rs index e3b420a7a..bb3892a68 100644 --- a/src/routes/maven.rs +++ b/src/routes/maven.rs @@ -108,7 +108,7 @@ pub async fn maven_metadata( .map(|x| x.version_number.clone()) .collect::>(), }, - last_updated: data.inner.updated.format("%Y%m%d%H%M%S"), + last_updated: data.inner.updated.format("%Y%m%d%H%M%S").to_string(), }, }; diff --git a/src/routes/project_creation.rs b/src/routes/project_creation.rs index 0e52053eb..59a21f181 100644 --- a/src/routes/project_creation.rs +++ b/src/routes/project_creation.rs @@ -14,13 +14,13 @@ use actix_multipart::{Field, Multipart}; use actix_web::http::StatusCode; use actix_web::web::Data; use actix_web::{post, HttpRequest, HttpResponse}; +use chrono::Utc; use futures::stream::StreamExt; use serde::{Deserialize, Serialize}; use sqlx::postgres::PgPool; use std::collections::HashSet; use std::sync::Arc; use thiserror::Error; -use time::OffsetDateTime; use validator::Validate; #[derive(Error, Debug)] @@ -166,6 +166,9 @@ struct ProjectCreateData { #[validate(length(max = 3))] /// A list of the categories that the project is in. pub categories: Vec, + #[validate(length(max = 256))] + /// A list of the categories that the project is in. + pub additional_categories: Vec, #[validate(url, length(max = 2048))] /// An optional link to where to submit bugs or issues with the project. @@ -388,7 +391,7 @@ pub async fn project_create_inner( { let results = sqlx::query!( " - SELECT EXISTS(SELECT 1 FROM mods WHERE slug = $1) + SELECT EXISTS(SELECT 1 FROM mods WHERE slug = LOWER($1)) ", create_data.slug ) @@ -522,7 +525,7 @@ pub async fn project_create_inner( featured: item.featured, title: item.title.clone(), description: item.description.clone(), - created: OffsetDateTime::now_utc(), + created: Utc::now(), }); continue; @@ -593,6 +596,19 @@ pub async fn project_create_inner( categories.push(id); } + let mut additional_categories = + Vec::with_capacity(project_create_data.additional_categories.len()); + for category in &project_create_data.additional_categories { + let id = models::categories::Category::get_id_project( + category, + project_type_id, + &mut *transaction, + ) + .await? + .ok_or_else(|| CreateError::InvalidCategory(category.clone()))?; + additional_categories.push(id); + } + let team = models::team_item::TeamBuilder { members: vec![models::team_item::TeamMemberBuilder { user_id: current_user.id.into(), @@ -698,6 +714,7 @@ pub async fn project_create_inner( license_url: project_create_data.license_url, discord_url: project_create_data.discord_url, categories, + additional_categories, initial_versions: versions, status: status_id, client_side: client_side_id, @@ -718,7 +735,7 @@ pub async fn project_create_inner( .collect(), }; - let now = OffsetDateTime::now_utc(); + let now = Utc::now(); let response = crate::models::projects::Project { id: project_id, @@ -731,6 +748,7 @@ pub async fn project_create_inner( body_url: None, published: now, updated: now, + approved: None, status: status.clone(), moderator_message: None, license: License { @@ -743,6 +761,7 @@ pub async fn project_create_inner( downloads: 0, followers: 0, categories: project_create_data.categories, + additional_categories: project_create_data.additional_categories, versions: project_builder .initial_versions .iter() diff --git a/src/routes/projects.rs b/src/routes/projects.rs index 2cb6073f7..b934b06e3 100644 --- a/src/routes/projects.rs +++ b/src/routes/projects.rs @@ -11,12 +11,12 @@ use crate::util::auth::{get_user_from_headers, is_authorized}; use crate::util::routes::read_from_payload; use crate::util::validate::validation_errors_to_string; use actix_web::{delete, get, patch, post, web, HttpRequest, HttpResponse}; +use chrono::Utc; use futures::StreamExt; use serde::{Deserialize, Serialize}; use serde_json::json; use sqlx::{PgPool, Row}; use std::sync::Arc; -use time::OffsetDateTime; use validator::Validate; #[get("search")] @@ -112,7 +112,7 @@ pub async fn project_get_check( sqlx::query!( " SELECT id FROM mods - WHERE LOWER(slug) = LOWER($1) + WHERE slug = LOWER($1) ", &slug ) @@ -126,7 +126,7 @@ pub async fn project_get_check( sqlx::query!( " SELECT id FROM mods - WHERE LOWER(slug) = LOWER($1) + WHERE slug = LOWER($1) ", &slug ) @@ -259,6 +259,8 @@ pub struct EditProject { pub body: Option, #[validate(length(max = 3))] pub categories: Option>, + #[validate(length(max = 256))] + pub additional_categories: Option>, #[serde( default, skip_serializing_if = "Option::is_none", @@ -483,6 +485,21 @@ pub async fn project_edit( ) })?; + if status == &ProjectStatus::Approved + || status == &ProjectStatus::Unlisted + { + sqlx::query!( + " + UPDATE mods + SET published = NOW() + WHERE id = $1 AND approved = NULL + ", + id as database::models::ids::ProjectId, + ) + .execute(&mut *transaction) + .await?; + } + sqlx::query!( " UPDATE mods @@ -513,7 +530,7 @@ pub async fn project_edit( sqlx::query!( " DELETE FROM mods_categories - WHERE joining_mod_id = $1 + WHERE joining_mod_id = $1 AND is_additional = FALSE ", id as database::models::ids::ProjectId, ) @@ -536,8 +553,8 @@ pub async fn project_edit( sqlx::query!( " - INSERT INTO mods_categories (joining_mod_id, joining_category_id) - VALUES ($1, $2) + INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional) + VALUES ($1, $2, FALSE) ", id as database::models::ids::ProjectId, category_id as database::models::ids::CategoryId, @@ -547,6 +564,51 @@ pub async fn project_edit( } } + if let Some(categories) = &new_project.additional_categories { + if !perms.contains(Permissions::EDIT_DETAILS) { + return Err(ApiError::CustomAuthentication( + "You do not have the permissions to edit the additional categories of this project!" + .to_string(), + )); + } + + sqlx::query!( + " + DELETE FROM mods_categories + WHERE joining_mod_id = $1 AND is_additional = TRUE + ", + id as database::models::ids::ProjectId, + ) + .execute(&mut *transaction) + .await?; + + for category in categories { + let category_id = + database::models::categories::Category::get_id( + category, + &mut *transaction, + ) + .await? + .ok_or_else(|| { + ApiError::InvalidInput(format!( + "Category {} does not exist.", + category.clone() + )) + })?; + + sqlx::query!( + " + INSERT INTO mods_categories (joining_mod_id, joining_category_id, is_additional) + VALUES ($1, $2, TRUE) + ", + id as database::models::ids::ProjectId, + category_id as database::models::ids::CategoryId, + ) + .execute(&mut *transaction) + .await?; + } + } + if let Some(issues_url) = &new_project.issues_url { if !perms.contains(Permissions::EDIT_DETAILS) { return Err(ApiError::CustomAuthentication( @@ -1178,7 +1240,7 @@ pub async fn add_gallery_item( featured: item.featured, title: item.title, description: item.description, - created: OffsetDateTime::now_utc(), + created: Utc::now(), } .insert(&mut transaction) .await?; diff --git a/src/routes/reports.rs b/src/routes/reports.rs index 46b3ab274..44d2d5045 100644 --- a/src/routes/reports.rs +++ b/src/routes/reports.rs @@ -5,10 +5,10 @@ use crate::util::auth::{ check_is_moderator_from_headers, get_user_from_headers, }; use actix_web::{delete, get, post, web, HttpRequest, HttpResponse}; +use chrono::Utc; use futures::StreamExt; use serde::Deserialize; use sqlx::PgPool; -use time::OffsetDateTime; #[derive(Deserialize)] pub struct CreateReport { @@ -60,7 +60,7 @@ pub async fn report_create( user_id: None, body: new_report.body.clone(), reporter: current_user.id.into(), - created: OffsetDateTime::now_utc(), + created: Utc::now(), }; match new_report.item_type { @@ -109,7 +109,7 @@ pub async fn report_create( item_type: new_report.item_type.clone(), reporter: current_user.id, body: new_report.body.clone(), - created: OffsetDateTime::now_utc(), + created: Utc::now(), })) } diff --git a/src/routes/tags.rs b/src/routes/tags.rs index e8a13fc34..8207a0551 100644 --- a/src/routes/tags.rs +++ b/src/routes/tags.rs @@ -5,9 +5,9 @@ use crate::database::models::categories::{ }; use crate::util::auth::check_is_admin_from_headers; use actix_web::{delete, get, put, web, HttpRequest, HttpResponse}; +use chrono::{DateTime, Utc}; use models::categories::{Category, GameVersion, Loader}; use sqlx::PgPool; -use time::OffsetDateTime; pub fn config(cfg: &mut web::ServiceConfig) { cfg.service( @@ -38,6 +38,7 @@ pub struct CategoryData { icon: String, name: String, project_type: String, + header: String, } // TODO: searching / filtering? Could be used to implement a live @@ -53,6 +54,7 @@ pub async fn category_list( icon: x.icon, name: x.category, project_type: x.project_type, + header: x.header, }) .collect::>(); @@ -84,6 +86,7 @@ pub async fn category_create( .name(&new_category.name)? .project_type(&project_type)? .icon(&new_category.icon)? + .header(&new_category.header)? .insert(&**pool) .await?; @@ -202,8 +205,7 @@ pub async fn loader_delete( pub struct GameVersionQueryData { pub version: String, pub version_type: String, - #[serde(with = "crate::util::time_ser")] - pub date: OffsetDateTime, + pub date: DateTime, pub major: bool, } @@ -243,7 +245,7 @@ pub async fn game_version_list( pub struct GameVersionData { #[serde(rename = "type")] type_: String, - date: Option, + date: Option>, } #[put("game_version/{name}")] diff --git a/src/routes/v1/reports.rs b/src/routes/v1/reports.rs index b7d4b0597..d39c2bf6f 100644 --- a/src/routes/v1/reports.rs +++ b/src/routes/v1/reports.rs @@ -7,10 +7,10 @@ use crate::util::auth::{ }; use actix_web::web; use actix_web::{get, post, HttpRequest, HttpResponse}; +use chrono::{DateTime, Utc}; use futures::StreamExt; use serde::{Deserialize, Serialize}; use sqlx::PgPool; -use time::OffsetDateTime; #[derive(Serialize, Deserialize)] pub struct Report { @@ -20,8 +20,7 @@ pub struct Report { pub item_type: ItemType, pub reporter: UserId, pub body: String, - #[serde(with = "crate::util::time_ser")] - pub created: OffsetDateTime, + pub created: DateTime, } #[derive(Serialize, Deserialize, Clone)] @@ -93,7 +92,7 @@ pub async fn report_create( user_id: None, body: new_report.body.clone(), reporter: current_user.id.into(), - created: OffsetDateTime::now_utc(), + created: Utc::now(), }; match new_report.item_type { @@ -142,7 +141,7 @@ pub async fn report_create( item_type: new_report.item_type.clone(), reporter: current_user.id, body: new_report.body.clone(), - created: OffsetDateTime::now_utc(), + created: Utc::now(), })) } diff --git a/src/routes/v1/versions.rs b/src/routes/v1/versions.rs index 336104a63..04a4420a9 100644 --- a/src/routes/v1/versions.rs +++ b/src/routes/v1/versions.rs @@ -9,10 +9,10 @@ use crate::routes::ApiError; use crate::util::auth::get_user_from_headers; use crate::{database, models}; use actix_web::{delete, get, web, HttpRequest, HttpResponse}; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use sqlx::PgPool; use std::sync::Arc; -use time::OffsetDateTime; /// A specific version of a mod #[derive(Serialize, Deserialize)] @@ -25,8 +25,7 @@ pub struct LegacyVersion { pub version_number: String, pub changelog: String, pub changelog_url: Option, - #[serde(with = "crate::util::time_ser")] - pub date_published: OffsetDateTime, + pub date_published: DateTime, pub downloads: u32, pub version_type: VersionType, pub files: Vec, diff --git a/src/routes/version_creation.rs b/src/routes/version_creation.rs index 24cf53094..0ba7ecc1e 100644 --- a/src/routes/version_creation.rs +++ b/src/routes/version_creation.rs @@ -18,10 +18,10 @@ use crate::validate::{validate_file, ValidationResult}; use actix_multipart::{Field, Multipart}; use actix_web::web::Data; use actix_web::{post, HttpRequest, HttpResponse}; +use chrono::Utc; use futures::stream::StreamExt; use serde::{Deserialize, Serialize}; use sqlx::postgres::PgPool; -use time::OffsetDateTime; use validator::Validate; #[derive(Serialize, Deserialize, Validate, Clone)] @@ -402,7 +402,7 @@ async fn version_create_inner( version_number: builder.version_number.clone(), changelog: builder.changelog.clone(), changelog_url: None, - date_published: OffsetDateTime::now_utc(), + date_published: Utc::now(), downloads: 0, version_type: version_data.release_channel, files: builder @@ -722,23 +722,18 @@ pub async fn upload_file( for file in &format.files { if let Some(dep) = res.iter().find(|x| { - x.hash.as_deref() + Some(&*x.hash) == file .hashes .get(&PackFileHash::Sha1) .map(|x| x.as_bytes()) }) { - if let Some(project_id) = dep.project_id { - if let Some(version_id) = dep.version_id { - dependencies.push(DependencyBuilder { - project_id: Some(models::ProjectId(project_id)), - version_id: Some(models::VersionId(version_id)), - file_name: None, - dependency_type: DependencyType::Embedded - .to_string(), - }); - } - } + dependencies.push(DependencyBuilder { + project_id: Some(models::ProjectId(dep.project_id)), + version_id: Some(models::VersionId(dep.version_id)), + file_name: None, + dependency_type: DependencyType::Embedded.to_string(), + }); } else if let Some(first_download) = file.downloads.first() { dependencies.push(DependencyBuilder { project_id: None, diff --git a/src/scheduler.rs b/src/scheduler.rs index 045baa7ec..2cf01c1c5 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -73,9 +73,8 @@ pub enum VersionIndexingError { } use crate::util::env::parse_var; +use chrono::{DateTime, Utc}; use serde::Deserialize; -use time::Format::Rfc3339; -use time::OffsetDateTime; use tokio_stream::wrappers::IntervalStream; #[derive(Deserialize)] @@ -88,8 +87,8 @@ struct VersionFormat<'a> { id: String, #[serde(rename = "type")] type_: std::borrow::Cow<'a, str>, - #[serde(rename = "releaseTime", with = "crate::util::time_ser")] - release_time: OffsetDateTime, + #[serde(rename = "releaseTime")] + release_time: DateTime, } async fn update_versions( @@ -128,26 +127,30 @@ async fn update_versions( lazy_static::lazy_static! { /// Mojank for some reason has versions released at the same DateTime. This hardcodes them to fix this, /// as most of our ordering logic is with DateTime - static ref HALL_OF_SHAME_2: [(&'static str, OffsetDateTime); 4] = [ + static ref HALL_OF_SHAME_2: [(&'static str, chrono::DateTime); 4] = [ ( "1.4.5", - OffsetDateTime::parse("2012-12-19T22:00:00+00:00", Rfc3339) + chrono::DateTime::parse_from_rfc3339("2012-12-19T22:00:00+00:00") .unwrap() + .into(), ), ( "1.4.6", - OffsetDateTime::parse("2012-12-19T22:00:01+00:00", Rfc3339) + chrono::DateTime::parse_from_rfc3339("2012-12-19T22:00:01+00:00") .unwrap() + .into(), ), ( "1.6.3", - OffsetDateTime::parse("2013-09-13T10:54:41+00:00", Rfc3339) + chrono::DateTime::parse_from_rfc3339("2013-09-13T10:54:41+00:00") .unwrap() + .into(), ), ( "13w37b", - OffsetDateTime::parse("2013-09-13T10:54:42+00:00", Rfc3339) + chrono::DateTime::parse_from_rfc3339("2013-09-13T10:54:42+00:00") .unwrap() + .into(), ), ]; } diff --git a/src/search/indexing/local_import.rs b/src/search/indexing/local_import.rs index 31fa88ae1..3c76e4c43 100644 --- a/src/search/indexing/local_import.rs +++ b/src/search/indexing/local_import.rs @@ -6,26 +6,23 @@ use crate::database::models::ProjectId; use crate::search::UploadSearchProject; use sqlx::postgres::PgPool; -// TODO: Move this away from STRING_AGG to multiple queries - however this may be more efficient? pub async fn index_local( pool: PgPool, ) -> Result, IndexingError> { info!("Indexing local projects!"); Ok( sqlx::query!( - //FIXME: there must be a way to reduce the duplicate lines between this query and the one in `query_one` here... - //region query " SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows, - m.icon_url icon_url, m.published published, - m.updated updated, + m.icon_url icon_url, m.published published, m.approved approved, m.updated updated, m.team_id team_id, m.license license, m.slug slug, s.status status_name, cs.name client_side_type, ss.name server_side_type, l.short short, pt.name project_type_name, u.username username, - STRING_AGG(DISTINCT c.category, ',') categories, STRING_AGG(DISTINCT lo.loader, ',') loaders, STRING_AGG(DISTINCT gv.version, ',') versions, - STRING_AGG(DISTINCT mg.image_url, ',') gallery + ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories, ARRAY_AGG(DISTINCT cp.category) filter (where cp.category is not null) primary_categories, ARRAY_AGG(DISTINCT lo.loader) filter (where lo.loader is not null) loaders, ARRAY_AGG(DISTINCT gv.version) filter (where gv.version is not null) versions, + ARRAY_AGG(DISTINCT mg.image_url) filter (where mg.image_url is not null) gallery FROM mods m LEFT OUTER JOIN mods_categories mc ON joining_mod_id = m.id LEFT OUTER JOIN categories c ON mc.joining_category_id = c.id + LEFT OUTER JOIN categories cp ON mc.joining_category_id = c.id AND mc.is_additional = FALSE LEFT OUTER JOIN versions v ON v.mod_id = m.id LEFT OUTER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id LEFT OUTER JOIN game_versions gv ON gvv.game_version_id = gv.id @@ -42,7 +39,6 @@ pub async fn index_local( WHERE s.status = $1 OR s.status = $2 GROUP BY m.id, s.id, cs.id, ss.id, l.id, pt.id, u.id; ", - //endregion query crate::models::projects::ProjectStatus::Approved.as_str(), crate::models::projects::ProjectStatus::Archived.as_str(), crate::models::teams::OWNER_ROLE, @@ -50,15 +46,12 @@ pub async fn index_local( .fetch_many(&pool) .try_filter_map(|e| async { Ok(e.right().map(|m| { - let mut categories = split_to_strings(m.categories); - categories.append(&mut split_to_strings(m.loaders)); - let versions = split_to_strings(m.versions); + let mut categories = m.categories.unwrap_or_default(); + categories.append(&mut m.loaders.unwrap_or_default()); + let versions = m.versions.unwrap_or_default(); let project_id: crate::models::projects::ProjectId = ProjectId(m.id).into(); - // TODO: Cleanup - This method has a lot of code in common with the method below. - // But, since the macro returns an (de facto) unnamed struct, - // We cannot reuse the code easily. Ugh. UploadSearchProject { project_id: format!("{}", project_id), title: m.title, @@ -69,9 +62,9 @@ pub async fn index_local( icon_url: m.icon_url.unwrap_or_default(), author: m.username, date_created: m.published, - created_timestamp: m.published.unix_timestamp(), + created_timestamp: m.approved.unwrap_or(m.published).timestamp(), date_modified: m.updated, - modified_timestamp: m.updated.unix_timestamp(), + modified_timestamp: m.updated.timestamp(), latest_version: versions.last().cloned().unwrap_or_else(|| "None".to_string()), versions, license: m.short, @@ -79,7 +72,8 @@ pub async fn index_local( server_side: m.server_side_type, slug: m.slug, project_type: m.project_type_name, - gallery: m.gallery.map(|x| x.split(',').map(|x| x.to_string()).collect()).unwrap_or_default() + gallery: m.gallery.unwrap_or_default(), + display_categories: m.primary_categories.unwrap_or_default() } })) }) @@ -87,8 +81,3 @@ pub async fn index_local( .await? ) } - -fn split_to_strings(s: Option) -> Vec { - s.map(|x| x.split(',').map(ToString::to_string).collect()) - .unwrap_or_default() -} diff --git a/src/search/indexing/mod.rs b/src/search/indexing/mod.rs index e8cf2a557..8141f8ce9 100644 --- a/src/search/indexing/mod.rs +++ b/src/search/indexing/mod.rs @@ -15,8 +15,6 @@ pub enum IndexingError { Indexing(#[from] meilisearch_sdk::errors::Error), #[error("Error while serializing or deserializing JSON: {0}")] Serde(#[from] serde_json::Error), - #[error("Error while parsing a timestamp: {0}")] - ParseDate(#[from] time::error::Error), #[error("Database Error: {0}")] Sqlx(#[from] sqlx::error::Error), #[error("Database Error: {0}")] diff --git a/src/search/mod.rs b/src/search/mod.rs index 84facfb47..406e919aa 100644 --- a/src/search/mod.rs +++ b/src/search/mod.rs @@ -2,13 +2,13 @@ use crate::models::error::ApiError; use crate::models::projects::SearchRequest; use actix_web::http::StatusCode; use actix_web::HttpResponse; +use chrono::{DateTime, Utc}; use meilisearch_sdk::client::Client; use meilisearch_sdk::document::Document; use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::cmp::min; use thiserror::Error; -use time::OffsetDateTime; pub mod indexing; @@ -74,6 +74,7 @@ pub struct UploadSearchProject { pub title: String, pub description: String, pub categories: Vec, + pub display_categories: Vec, pub versions: Vec, pub follows: i32, pub downloads: i32, @@ -83,16 +84,12 @@ pub struct UploadSearchProject { pub client_side: String, pub server_side: String, pub gallery: Vec, - - #[serde(with = "crate::util::time_ser")] /// RFC 3339 formatted creation date of the project - pub date_created: OffsetDateTime, + pub date_created: DateTime, /// Unix timestamp of the creation date of the project pub created_timestamp: i64, - - #[serde(with = "crate::util::time_ser")] /// RFC 3339 formatted date/time of last major modification (update) - pub date_modified: OffsetDateTime, + pub date_modified: DateTime, /// Unix timestamp of the last major modification pub modified_timestamp: i64, } @@ -114,6 +111,7 @@ pub struct ResultSearchProject { pub title: String, pub description: String, pub categories: Vec, + pub display_categories: Vec, // TODO: more efficient format for listing versions, without many repetitions pub versions: Vec, pub downloads: i32, diff --git a/src/util/mod.rs b/src/util/mod.rs index d00f562b3..8d648cbf6 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -3,6 +3,5 @@ pub mod env; pub mod ext; pub mod guards; pub mod routes; -pub mod time_ser; pub mod validate; pub mod webhook; diff --git a/src/util/time_ser.rs b/src/util/time_ser.rs deleted file mode 100644 index 890a69ded..000000000 --- a/src/util/time_ser.rs +++ /dev/null @@ -1,42 +0,0 @@ -//! Use the well-known [RFC3339 format] when serializing and deserializing an [`OffsetDateTime`]. -//! -//! Use this module in combination with serde's [`#[with]`][with] attribute. -//! -//! [RFC3339 format]: https://tools.ietf.org/html/rfc3339#section-5.6 -//! [with]: https://serde.rs/field-attrs.html#with - -use core::fmt; -use core::marker::PhantomData; - -use serde::{de, Deserializer, Serialize, Serializer}; -use time::Format::Rfc3339; -use time::OffsetDateTime; - -/// Serialize an [`OffsetDateTime`] using the well-known RFC3339 format. -pub fn serialize( - datetime: &OffsetDateTime, - serializer: S, -) -> Result { - datetime.format(Rfc3339).serialize(serializer) -} - -/// Deserialize an [`OffsetDateTime`] from its RFC3339 representation. -pub fn deserialize<'a, D: Deserializer<'a>>( - deserializer: D, -) -> Result { - deserializer.deserialize_any(Visitor(PhantomData)) -} - -pub(super) struct Visitor(pub(super) PhantomData); - -impl<'a> de::Visitor<'a> for Visitor { - type Value = OffsetDateTime; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("an `OffsetDateTime`") - } - - fn visit_str(self, value: &str) -> Result { - OffsetDateTime::parse(value, Rfc3339).map_err(E::custom) - } -} diff --git a/src/util/webhook.rs b/src/util/webhook.rs index a8ffc9f17..ce3c91801 100644 --- a/src/util/webhook.rs +++ b/src/util/webhook.rs @@ -1,14 +1,13 @@ use crate::models::projects::Project; +use chrono::{DateTime, Utc}; use serde::Serialize; -use time::OffsetDateTime; #[derive(Serialize)] struct DiscordEmbed { pub title: String, pub description: String, pub url: String, - #[serde(with = "crate::util::time_ser")] - pub timestamp: OffsetDateTime, + pub timestamp: DateTime, pub color: u32, pub fields: Vec, pub image: DiscordEmbedImage, diff --git a/src/validate/fabric.rs b/src/validate/fabric.rs index 9da6a7149..aa0c20c54 100644 --- a/src/validate/fabric.rs +++ b/src/validate/fabric.rs @@ -1,8 +1,8 @@ use crate::validate::{ SupportedGameVersions, ValidationError, ValidationResult, }; +use chrono::{DateTime, NaiveDateTime, Utc}; use std::io::Cursor; -use time::OffsetDateTime; use zip::ZipArchive; pub struct FabricValidator; @@ -22,8 +22,9 @@ impl super::Validator for FabricValidator { fn get_supported_game_versions(&self) -> SupportedGameVersions { // Time since release of 18w49a, the first fabric version - SupportedGameVersions::PastDate(OffsetDateTime::from_unix_timestamp( - 1543969469, + SupportedGameVersions::PastDate(DateTime::from_utc( + NaiveDateTime::from_timestamp(1543969469, 0), + Utc, )) } diff --git a/src/validate/forge.rs b/src/validate/forge.rs index cf3f7e1e4..74f1ae62e 100644 --- a/src/validate/forge.rs +++ b/src/validate/forge.rs @@ -1,8 +1,8 @@ use crate::validate::{ SupportedGameVersions, ValidationError, ValidationResult, }; +use chrono::{DateTime, NaiveDateTime, Utc}; use std::io::Cursor; -use time::OffsetDateTime; use zip::ZipArchive; pub struct ForgeValidator; @@ -22,8 +22,9 @@ impl super::Validator for ForgeValidator { fn get_supported_game_versions(&self) -> SupportedGameVersions { // Time since release of 1.13, the first forge version which uses the new TOML system - SupportedGameVersions::PastDate(OffsetDateTime::from_unix_timestamp( - 1540122067, + SupportedGameVersions::PastDate(DateTime::::from_utc( + NaiveDateTime::from_timestamp(1540122067, 0), + Utc, )) } @@ -67,8 +68,14 @@ impl super::Validator for LegacyForgeValidator { fn get_supported_game_versions(&self) -> SupportedGameVersions { // Times between versions 1.5.2 to 1.12.2, which all use the legacy way of defining mods SupportedGameVersions::Range( - OffsetDateTime::from_unix_timestamp(1366818300), - OffsetDateTime::from_unix_timestamp(1505810340), + DateTime::from_utc( + NaiveDateTime::from_timestamp(1366818300, 0), + Utc, + ), + DateTime::from_utc( + NaiveDateTime::from_timestamp(1505810340, 0), + Utc, + ), ) } diff --git a/src/validate/mod.rs b/src/validate/mod.rs index b0844f505..32f219f87 100644 --- a/src/validate/mod.rs +++ b/src/validate/mod.rs @@ -7,9 +7,9 @@ use crate::validate::modpack::ModpackValidator; use crate::validate::plugin::*; use crate::validate::quilt::QuiltValidator; use crate::validate::resourcepack::{PackValidator, TexturePackValidator}; +use chrono::{DateTime, Utc}; use std::io::Cursor; use thiserror::Error; -use time::OffsetDateTime; use zip::ZipArchive; mod fabric; @@ -59,8 +59,8 @@ impl ValidationResult { pub enum SupportedGameVersions { All, - PastDate(OffsetDateTime), - Range(OffsetDateTime, OffsetDateTime), + PastDate(DateTime), + Range(DateTime, DateTime), #[allow(dead_code)] Custom(Vec), } diff --git a/src/validate/quilt.rs b/src/validate/quilt.rs index 927002896..f751e6745 100644 --- a/src/validate/quilt.rs +++ b/src/validate/quilt.rs @@ -1,8 +1,8 @@ use crate::validate::{ SupportedGameVersions, ValidationError, ValidationResult, }; +use chrono::{DateTime, NaiveDateTime, Utc}; use std::io::Cursor; -use time::OffsetDateTime; use zip::ZipArchive; pub struct QuiltValidator; @@ -21,9 +21,9 @@ impl super::Validator for QuiltValidator { } fn get_supported_game_versions(&self) -> SupportedGameVersions { - // Time since release of 18w49a, the first fabric version - SupportedGameVersions::PastDate(OffsetDateTime::from_unix_timestamp( - 1646070100, + SupportedGameVersions::PastDate(DateTime::from_utc( + NaiveDateTime::from_timestamp(1646070100, 0), + Utc, )) } diff --git a/src/validate/resourcepack.rs b/src/validate/resourcepack.rs index dcdfeedc2..d8c54f5d2 100644 --- a/src/validate/resourcepack.rs +++ b/src/validate/resourcepack.rs @@ -1,8 +1,8 @@ use crate::validate::{ SupportedGameVersions, ValidationError, ValidationResult, }; +use chrono::{DateTime, NaiveDateTime, Utc}; use std::io::Cursor; -use time::OffsetDateTime; use zip::ZipArchive; pub struct PackValidator; @@ -22,8 +22,9 @@ impl super::Validator for PackValidator { fn get_supported_game_versions(&self) -> SupportedGameVersions { // Time since release of 13w24a which replaced texture packs with resource packs - SupportedGameVersions::PastDate(OffsetDateTime::from_unix_timestamp( - 1371137542, + SupportedGameVersions::PastDate(DateTime::from_utc( + NaiveDateTime::from_timestamp(1371137542, 0), + Utc, )) } @@ -59,8 +60,14 @@ impl super::Validator for TexturePackValidator { fn get_supported_game_versions(&self) -> SupportedGameVersions { // a1.2.2a to 13w23b SupportedGameVersions::Range( - OffsetDateTime::from_unix_timestamp(1289339999), - OffsetDateTime::from_unix_timestamp(1370651522), + DateTime::from_utc( + NaiveDateTime::from_timestamp(1289339999, 0), + Utc, + ), + DateTime::from_utc( + NaiveDateTime::from_timestamp(1370651522, 0), + Utc, + ), ) }