From 7ef2492d03e1892132ea297070ce1b0477670418 Mon Sep 17 00:00:00 2001 From: aecsocket <43144841+aecsocket@users.noreply.github.com> Date: Thu, 13 Aug 2026 17:50:07 +0000 Subject: [PATCH] prepare --- ...83f82b979397364ac9f61abb9bc8833a0d51.json} | 46 +++--- ...b206d70238d0132dad1f8974ae1ac346d2bd8.json | 28 ---- ...cb1a9986509413b2115de367a82eb58bc62f3.json | 4 +- ...a136ddbe802cd3a4c649e4982d9f28ae097ed.json | 34 ----- ...a48057c24dece008dbf2c00c6ec135d8cef41.json | 60 -------- ...2beda18c30564fc90e5213e5237f505504558.json | 29 ---- ...5705f8efc09ac21e0cf9a15c4cce019aaeb05.json | 23 --- ...7da1a33a059b0a1d00b51e27b4a5399492b13.json | 15 -- ...8103c009077768b33c17e22dcef4774ae5814.json | 138 ------------------ ...04f69a6d12ff29e21a15f8fdd73386634a3ec.json | 19 --- ...5a5176583d2781dbb9aa428f8f920844f2a1e.json | 58 -------- 11 files changed, 29 insertions(+), 425 deletions(-) rename apps/labrinth/.sqlx/{query-26618d64eb4ca9f14ed5cb5f143b593c4b16a3cfcff82a4ce93604f5448e5781.json => query-020f0da009002bd07c9711d617ea83f82b979397364ac9f61abb9bc8833a0d51.json} (57%) delete mode 100644 apps/labrinth/.sqlx/query-17dc154d8cf4d857d2611c21352b206d70238d0132dad1f8974ae1ac346d2bd8.json delete mode 100644 apps/labrinth/.sqlx/query-4ccad9e07ae61ba87b1784b6ee9a136ddbe802cd3a4c649e4982d9f28ae097ed.json delete mode 100644 apps/labrinth/.sqlx/query-6241bc72a80de01fd8e5506442da48057c24dece008dbf2c00c6ec135d8cef41.json delete mode 100644 apps/labrinth/.sqlx/query-73e3646a21e4acb1299f0b183b92beda18c30564fc90e5213e5237f505504558.json delete mode 100644 apps/labrinth/.sqlx/query-87d4778e52ac3e9fd885f9c77595705f8efc09ac21e0cf9a15c4cce019aaeb05.json delete mode 100644 apps/labrinth/.sqlx/query-9eea063cb153da407548f957cef7da1a33a059b0a1d00b51e27b4a5399492b13.json delete mode 100644 apps/labrinth/.sqlx/query-b3aaa0b2f38950057d845b3d4dc8103c009077768b33c17e22dcef4774ae5814.json delete mode 100644 apps/labrinth/.sqlx/query-d4b427672138b0c75f123a23ce104f69a6d12ff29e21a15f8fdd73386634a3ec.json delete mode 100644 apps/labrinth/.sqlx/query-dc13b4d8b84681dc4f1ea5f4f735a5176583d2781dbb9aa428f8f920844f2a1e.json diff --git a/apps/labrinth/.sqlx/query-26618d64eb4ca9f14ed5cb5f143b593c4b16a3cfcff82a4ce93604f5448e5781.json b/apps/labrinth/.sqlx/query-020f0da009002bd07c9711d617ea83f82b979397364ac9f61abb9bc8833a0d51.json similarity index 57% rename from apps/labrinth/.sqlx/query-26618d64eb4ca9f14ed5cb5f143b593c4b16a3cfcff82a4ce93604f5448e5781.json rename to apps/labrinth/.sqlx/query-020f0da009002bd07c9711d617ea83f82b979397364ac9f61abb9bc8833a0d51.json index ecfdfc77f1..b54ef2d360 100644 --- a/apps/labrinth/.sqlx/query-26618d64eb4ca9f14ed5cb5f143b593c4b16a3cfcff82a4ce93604f5448e5781.json +++ b/apps/labrinth/.sqlx/query-020f0da009002bd07c9711d617ea83f82b979397364ac9f61abb9bc8833a0d51.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n\t\tSELECT\n\t\t\tdelphi_rule.id AS \"id!: DelphiRuleId\",\n\t\t\tdelphi_rule.name,\n\t\t\tdelphi_rule.rule,\n\t\t\tdelphi_rule.priority,\n\t\t\tdelphi_rule.revision,\n\t\t\tdelphi_rule.created_at,\n\t\t\tdelphi_rule.updated_at,\n\t\t\tdelphi_rule.created_by,\n\t\t\tdelphi_rule.updated_by,\n\t\t\tCOALESCE(preview.affected_details_count, 0)\n\t\t\t\tAS \"affected_details_count!\",\n\t\t\tpreview.detail_id AS \"detail_id?: DelphiReportIssueDetailsId\",\n\t\t\tpreview.issue_id AS \"issue_id?: DelphiReportIssueId\",\n\t\t\tpreview.project_id AS \"project_id?: DBProjectId\",\n\t\t\tpreview.project_name AS \"project_name?\",\n\t\t\tpreview.project_icon_url AS \"project_icon_url?\",\n\t\t\tpreview.version_id AS \"version_id?: DBVersionId\",\n\t\t\tpreview.version_name AS \"version_name?\",\n\t\t\tpreview.version_number AS \"version_number?\",\n\t\t\tpreview.issue_type AS \"issue_type?\",\n\t\t\tpreview.key AS \"key?\",\n\t\t\tpreview.jar AS \"jar?\",\n\t\t\tpreview.file_path AS \"file_path?\",\n\t\t\tpreview.original_severity AS \"original_severity?: DelphiSeverity\",\n\t\t\tpreview.severity AS \"effect_severity?: DelphiSeverity\"\n\t\tFROM delphi_rules delphi_rule\n\t\tLEFT JOIN LATERAL (\n\t\t\tSELECT\n\t\t\t\teffect.detail_id,\n\t\t\t\tdetail.issue_id,\n\t\t\t\tversion.mod_id AS project_id,\n\t\t\t\tproject.name AS project_name,\n\t\t\t\tproject.icon_url AS project_icon_url,\n\t\t\t\tversion.id AS version_id,\n\t\t\t\tversion.name AS version_name,\n\t\t\t\tversion.version_number,\n\t\t\t\tissue.issue_type,\n\t\t\t\tdetail.key,\n\t\t\t\tdetail.jar,\n\t\t\t\tdetail.file_path,\n\t\t\t\tdetail.severity AS original_severity,\n\t\t\t\teffect.severity,\n\t\t\t\tCOUNT(*) OVER () AS affected_details_count\n\t\t\tFROM delphi_rule_effects effect\n\t\t\tINNER JOIN delphi_rule_revisions published\n\t\t\t\tON published.revision = effect.revision\n\t\t\tINNER JOIN delphi_report_issue_details detail\n\t\t\t\tON detail.id = effect.detail_id\n\t\t\tINNER JOIN delphi_report_issues issue\n\t\t\t\tON issue.id = detail.issue_id\n\t\t\tINNER JOIN delphi_reports report\n\t\t\t\tON report.id = issue.report_id\n\t\t\tLEFT JOIN files file ON file.id = report.file_id\n\t\t\tLEFT JOIN versions version ON version.id = file.version_id\n\t\t\tLEFT JOIN mods project ON project.id = version.mod_id\n\t\t\tWHERE effect.rule_id = delphi_rule.id\n\t\t\tORDER BY effect.detail_id DESC\n\t\t\tLIMIT 3\n\t\t) preview ON TRUE\n\t\tWHERE NOT delphi_rule.delete_on_next_revision\n\t\tORDER BY\n\t\t\tdelphi_rule.priority DESC,\n\t\t\tdelphi_rule.id,\n\t\t\tpreview.detail_id DESC\n\t\t", + "query": "\n\t\tSELECT\n\t\t\tdelphi_rule.id AS \"id!: DelphiRuleId\",\n\t\t\tdelphi_rule.name,\n\t\t\tdelphi_rule.rule,\n\t\t\tdelphi_rule.priority,\n\t\t\tdelphi_rule.revision,\n\t\t\t(\n\t\t\t\tSELECT revision FROM delphi_rule_revisions LIMIT 1\n\t\t\t) AS \"current_revision!\",\n\t\t\tdelphi_rule.created_at,\n\t\t\tdelphi_rule.updated_at,\n\t\t\tdelphi_rule.created_by,\n\t\t\tdelphi_rule.updated_by,\n\t\t\tCOALESCE(preview.affected_details_count, 0)\n\t\t\t\tAS \"affected_details_count!\",\n\t\t\tpreview.detail_id AS \"detail_id?: DelphiReportIssueDetailsId\",\n\t\t\tpreview.issue_id AS \"issue_id?: DelphiReportIssueId\",\n\t\t\tpreview.project_id AS \"project_id?: DBProjectId\",\n\t\t\tpreview.project_name AS \"project_name?\",\n\t\t\tpreview.project_icon_url AS \"project_icon_url?\",\n\t\t\tpreview.version_id AS \"version_id?: DBVersionId\",\n\t\t\tpreview.version_name AS \"version_name?\",\n\t\t\tpreview.version_number AS \"version_number?\",\n\t\t\tpreview.issue_type AS \"issue_type?\",\n\t\t\tpreview.key AS \"key?\",\n\t\t\tpreview.jar AS \"jar?\",\n\t\t\tpreview.file_path AS \"file_path?\",\n\t\t\tpreview.original_severity AS \"original_severity?: DelphiSeverity\",\n\t\t\tpreview.severity AS \"effect_severity?: DelphiSeverity\"\n\t\tFROM delphi_rules delphi_rule\n\t\tLEFT JOIN LATERAL (\n\t\t\tSELECT\n\t\t\t\teffect.detail_id,\n\t\t\t\tdetail.issue_id,\n\t\t\t\tversion.mod_id AS project_id,\n\t\t\t\tproject.name AS project_name,\n\t\t\t\tproject.icon_url AS project_icon_url,\n\t\t\t\tversion.id AS version_id,\n\t\t\t\tversion.name AS version_name,\n\t\t\t\tversion.version_number,\n\t\t\t\tissue.issue_type,\n\t\t\t\tdetail.key,\n\t\t\t\tdetail.jar,\n\t\t\t\tdetail.file_path,\n\t\t\t\tdetail.severity AS original_severity,\n\t\t\t\teffect.severity,\n\t\t\t\tCOUNT(*) OVER () AS affected_details_count\n\t\t\tFROM delphi_rule_effects effect\n\t\t\tINNER JOIN delphi_rule_revisions published\n\t\t\t\tON published.revision = effect.revision\n\t\t\tINNER JOIN delphi_report_issue_details detail\n\t\t\t\tON detail.id = effect.detail_id\n\t\t\tINNER JOIN delphi_report_issues issue\n\t\t\t\tON issue.id = detail.issue_id\n\t\t\tINNER JOIN delphi_reports report\n\t\t\t\tON report.id = issue.report_id\n\t\t\tLEFT JOIN files file ON file.id = report.file_id\n\t\t\tLEFT JOIN versions version ON version.id = file.version_id\n\t\t\tLEFT JOIN mods project ON project.id = version.mod_id\n\t\t\tWHERE effect.rule_id = delphi_rule.id\n\t\t\tORDER BY effect.detail_id DESC\n\t\t\tLIMIT 3\n\t\t) preview ON TRUE\n\t\tWHERE NOT delphi_rule.delete_on_next_revision\n\t\tORDER BY\n\t\t\tdelphi_rule.priority DESC,\n\t\t\tdelphi_rule.id,\n\t\t\tpreview.detail_id DESC\n\t\t", "describe": { "columns": [ { @@ -30,91 +30,96 @@ }, { "ordinal": 5, + "name": "current_revision!", + "type_info": "Int8" + }, + { + "ordinal": 6, "name": "created_at", "type_info": "Timestamptz" }, { - "ordinal": 6, + "ordinal": 7, "name": "updated_at", "type_info": "Timestamptz" }, { - "ordinal": 7, + "ordinal": 8, "name": "created_by", "type_info": "Int8" }, { - "ordinal": 8, + "ordinal": 9, "name": "updated_by", "type_info": "Int8" }, { - "ordinal": 9, + "ordinal": 10, "name": "affected_details_count!", "type_info": "Int8" }, { - "ordinal": 10, + "ordinal": 11, "name": "detail_id?: DelphiReportIssueDetailsId", "type_info": "Int8" }, { - "ordinal": 11, + "ordinal": 12, "name": "issue_id?: DelphiReportIssueId", "type_info": "Int8" }, { - "ordinal": 12, + "ordinal": 13, "name": "project_id?: DBProjectId", "type_info": "Int8" }, { - "ordinal": 13, + "ordinal": 14, "name": "project_name?", "type_info": "Varchar" }, { - "ordinal": 14, + "ordinal": 15, "name": "project_icon_url?", "type_info": "Varchar" }, { - "ordinal": 15, + "ordinal": 16, "name": "version_id?: DBVersionId", "type_info": "Int8" }, { - "ordinal": 16, + "ordinal": 17, "name": "version_name?", "type_info": "Varchar" }, { - "ordinal": 17, + "ordinal": 18, "name": "version_number?", "type_info": "Varchar" }, { - "ordinal": 18, + "ordinal": 19, "name": "issue_type?", "type_info": "Text" }, { - "ordinal": 19, + "ordinal": 20, "name": "key?", "type_info": "Text" }, { - "ordinal": 20, + "ordinal": 21, "name": "jar?", "type_info": "Text" }, { - "ordinal": 21, + "ordinal": 22, "name": "file_path?", "type_info": "Text" }, { - "ordinal": 22, + "ordinal": 23, "name": "original_severity?: DelphiSeverity", "type_info": { "Custom": { @@ -133,7 +138,7 @@ } }, { - "ordinal": 23, + "ordinal": 24, "name": "effect_severity?: DelphiSeverity", "type_info": { "Custom": { @@ -161,6 +166,7 @@ false, false, false, + null, false, false, true, @@ -182,5 +188,5 @@ false ] }, - "hash": "26618d64eb4ca9f14ed5cb5f143b593c4b16a3cfcff82a4ce93604f5448e5781" + "hash": "020f0da009002bd07c9711d617ea83f82b979397364ac9f61abb9bc8833a0d51" } diff --git a/apps/labrinth/.sqlx/query-17dc154d8cf4d857d2611c21352b206d70238d0132dad1f8974ae1ac346d2bd8.json b/apps/labrinth/.sqlx/query-17dc154d8cf4d857d2611c21352b206d70238d0132dad1f8974ae1ac346d2bd8.json deleted file mode 100644 index b3a813243e..0000000000 --- a/apps/labrinth/.sqlx/query-17dc154d8cf4d857d2611c21352b206d70238d0132dad1f8974ae1ac346d2bd8.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH moderation_projects AS (\n SELECT\n m.id,\n m.slug,\n m.name,\n m.summary,\n m.description,\n m.queued,\n m.published,\n m.organization_id,\n m.team_id,\n m.components\n FROM mods m\n WHERE\n m.status = $1\n AND (\n $7::boolean = false\n OR NOT EXISTS (\n SELECT 1\n FROM delphi_issue_details_with_statuses didws\n WHERE didws.project_id = m.id\n AND didws.status = 'pending'\n )\n )\n ),\n external_dependencies AS (\n SELECT\n v.mod_id,\n COUNT(*) AS external_dependencies_count\n FROM versions v\n INNER JOIN moderation_projects mp ON mp.id = v.mod_id\n INNER JOIN dependencies d ON d.dependent_id = v.id\n WHERE d.dependency_file_name IS NOT NULL\n GROUP BY v.mod_id\n ),\n version_project_types AS (\n SELECT\n v.mod_id,\n ARRAY_AGG(DISTINCT pt.name::text) FILTER (WHERE pt.name IS NOT NULL) AS project_types\n FROM versions v\n INNER JOIN moderation_projects mp ON mp.id = v.mod_id\n INNER JOIN loaders_versions lv ON v.id = lv.version_id\n INNER JOIN loaders l ON lv.loader_id = l.id\n INNER JOIN loaders_project_types lpt ON lpt.joining_loader_id = l.id\n INNER JOIN project_types pt ON pt.id = lpt.joining_project_type_id\n WHERE v.status = ANY($2)\n GROUP BY v.mod_id\n ),\n queue_projects AS (\n SELECT\n mp.id,\n mp.slug,\n mp.name,\n mp.summary,\n mp.description,\n mp.queued,\n mp.published,\n search_organization.name AS organization_name,\n search_owner.username AS owner_name,\n CASE\n WHEN jsonb_typeof(mp.components -> 'minecraft_server') = 'object'\n THEN ARRAY_APPEND(\n ARRAY_REMOVE(\n COALESCE(vpt.project_types::text[], ARRAY[]::text[]),\n 'modpack'\n ),\n 'minecraft_java_server'\n )\n ELSE COALESCE(vpt.project_types::text[], ARRAY[]::text[])\n END AS project_types,\n COALESCE(ed.external_dependencies_count, 0) AS external_dependencies_count\n FROM moderation_projects mp\n LEFT JOIN organizations search_organization\n ON search_organization.id = mp.organization_id\n AND $3::text IS NOT NULL\n LEFT JOIN LATERAL (\n SELECT\n u.username\n FROM team_members tm\n INNER JOIN users u ON u.id = tm.user_id\n WHERE tm.team_id = mp.team_id\n AND tm.is_owner\n ORDER BY tm.ordering ASC\n LIMIT 1\n ) search_owner ON $3::text IS NOT NULL\n AND mp.organization_id IS NULL\n LEFT JOIN external_dependencies ed ON ed.mod_id = mp.id\n LEFT JOIN version_project_types vpt ON vpt.mod_id = mp.id\n )\n SELECT id\n FROM queue_projects\n WHERE\n (\n $3::text IS NULL\n OR name ILIKE '%' || $3 || '%'\n OR slug ILIKE '%' || $3 || '%'\n OR summary ILIKE '%' || $3 || '%'\n OR description ILIKE '%' || $3 || '%'\n OR owner_name ILIKE '%' || $3 || '%'\n OR organization_name ILIKE '%' || $3 || '%'\n OR EXISTS (\n SELECT 1\n FROM UNNEST(project_types) AS searched_project_type(project_type)\n WHERE searched_project_type.project_type ILIKE '%' || $3 || '%'\n )\n )\n AND (\n $4::text IS NULL\n OR ($4 = 'none' AND CARDINALITY(project_types) = 0)\n OR ($4 = 'minecraft_java_server' AND project_types @> ARRAY['minecraft_java_server']::text[])\n OR ($4 <> 'none' AND $4 <> 'minecraft_java_server' AND project_types[1] = $4)\n )\n AND ($5::boolean IS NULL OR (external_dependencies_count > 0) = $5)\n ORDER BY\n CASE WHEN $6 = 'most_external_deps' THEN external_dependencies_count END DESC,\n CASE WHEN $6 = 'least_external_deps' THEN external_dependencies_count END ASC,\n CASE WHEN $6 = 'newest' THEN COALESCE(queued, published) END DESC NULLS LAST,\n CASE WHEN $6 IN ('oldest', 'most_external_deps', 'least_external_deps') THEN COALESCE(queued, published) END ASC NULLS LAST,\n id ASC\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text", - "TextArray", - "Text", - "Text", - "Bool", - "Text", - "Bool" - ] - }, - "nullable": [ - false - ] - }, - "hash": "17dc154d8cf4d857d2611c21352b206d70238d0132dad1f8974ae1ac346d2bd8" -} diff --git a/apps/labrinth/.sqlx/query-3b0d78d18738798fd6be69c040bcb1a9986509413b2115de367a82eb58bc62f3.json b/apps/labrinth/.sqlx/query-3b0d78d18738798fd6be69c040bcb1a9986509413b2115de367a82eb58bc62f3.json index 038af2b807..434a2f596b 100644 --- a/apps/labrinth/.sqlx/query-3b0d78d18738798fd6be69c040bcb1a9986509413b2115de367a82eb58bc62f3.json +++ b/apps/labrinth/.sqlx/query-3b0d78d18738798fd6be69c040bcb1a9986509413b2115de367a82eb58bc62f3.json @@ -76,10 +76,12 @@ "name": "delphi_severity", "kind": { "Enum": [ + "hidden", "low", "medium", "high", - "severe" + "severe", + "malware" ] } } diff --git a/apps/labrinth/.sqlx/query-4ccad9e07ae61ba87b1784b6ee9a136ddbe802cd3a4c649e4982d9f28ae097ed.json b/apps/labrinth/.sqlx/query-4ccad9e07ae61ba87b1784b6ee9a136ddbe802cd3a4c649e4982d9f28ae097ed.json deleted file mode 100644 index 212faa2dca..0000000000 --- a/apps/labrinth/.sqlx/query-4ccad9e07ae61ba87b1784b6ee9a136ddbe802cd3a4c649e4982d9f28ae097ed.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT project_id, type, metadata\n FROM project_disclosures\n WHERE project_id = ANY($1)\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "project_id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "type", - "type_info": "Text" - }, - { - "ordinal": 2, - "name": "metadata", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, - "nullable": [ - false, - false, - false - ] - }, - "hash": "4ccad9e07ae61ba87b1784b6ee9a136ddbe802cd3a4c649e4982d9f28ae097ed" -} diff --git a/apps/labrinth/.sqlx/query-6241bc72a80de01fd8e5506442da48057c24dece008dbf2c00c6ec135d8cef41.json b/apps/labrinth/.sqlx/query-6241bc72a80de01fd8e5506442da48057c24dece008dbf2c00c6ec135d8cef41.json deleted file mode 100644 index 665cd936e4..0000000000 --- a/apps/labrinth/.sqlx/query-6241bc72a80de01fd8e5506442da48057c24dece008dbf2c00c6ec135d8cef41.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH project_ids AS (\n SELECT unnest($1::bigint[]) AS project_id\n ),\n detail_states AS (\n SELECT\n p.project_id,\n COALESCE(\n BOOL_OR(\n didws.status = 'pending'\n AND dri.issue_type != $3\n ),\n FALSE\n ) AS has_pending_detail,\n COALESCE(\n BOOL_OR(\n didws.status = 'unsafe'\n AND dri.issue_type != $3\n ),\n FALSE\n ) AS has_unsafe_detail,\n COALESCE(\n BOOL_OR(\n didws.status = 'pending'\n AND dri.issue_type = $3\n ),\n FALSE\n ) AS has_dummy\n FROM project_ids p\n LEFT JOIN delphi_issue_details_with_statuses didws\n ON didws.project_id = p.project_id\n LEFT JOIN delphi_report_issues dri ON dri.id = didws.issue_id\n GROUP BY p.project_id\n )\n SELECT\n p.project_id AS \"project_id!: DBProjectId\",\n p.has_pending_detail AS \"has_pending_detail!\",\n p.has_unsafe_detail AS \"has_unsafe_detail!\",\n p.has_dummy AS \"has_dummy!\",\n (\n SELECT t.id\n FROM threads t\n WHERE t.mod_id = p.project_id\n ORDER BY t.id\n LIMIT 1\n ) AS \"thread_id: DBThreadId\",\n (\n SELECT tm.body->>'type'\n FROM threads t\n INNER JOIN threads_messages tm ON tm.thread_id = t.id\n WHERE\n t.mod_id = p.project_id\n AND tm.body->>'type' = ANY($2::text[])\n ORDER BY tm.created DESC, tm.id DESC\n LIMIT 1\n ) AS \"last_tech_review_message_type\",\n (\n SELECT dr.id\n FROM versions v\n INNER JOIN files f ON f.version_id = v.id\n INNER JOIN delphi_reports dr ON dr.file_id = f.id\n WHERE v.mod_id = p.project_id\n ORDER BY dr.created DESC, dr.id DESC\n LIMIT 1\n ) AS \"report_id: DelphiReportId\"\n FROM detail_states p\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "project_id!: DBProjectId", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "has_pending_detail!", - "type_info": "Bool" - }, - { - "ordinal": 2, - "name": "has_unsafe_detail!", - "type_info": "Bool" - }, - { - "ordinal": 3, - "name": "has_dummy!", - "type_info": "Bool" - }, - { - "ordinal": 4, - "name": "thread_id: DBThreadId", - "type_info": "Int8" - }, - { - "ordinal": 5, - "name": "last_tech_review_message_type", - "type_info": "Text" - }, - { - "ordinal": 6, - "name": "report_id: DelphiReportId", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8Array", - "TextArray", - "Text" - ] - }, - "nullable": [ - null, - null, - null, - null, - null, - null, - null - ] - }, - "hash": "6241bc72a80de01fd8e5506442da48057c24dece008dbf2c00c6ec135d8cef41" -} diff --git a/apps/labrinth/.sqlx/query-73e3646a21e4acb1299f0b183b92beda18c30564fc90e5213e5237f505504558.json b/apps/labrinth/.sqlx/query-73e3646a21e4acb1299f0b183b92beda18c30564fc90e5213e5237f505504558.json deleted file mode 100644 index f0a4d22896..0000000000 --- a/apps/labrinth/.sqlx/query-73e3646a21e4acb1299f0b183b92beda18c30564fc90e5213e5237f505504558.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH incoming AS (\n SELECT *\n FROM unnest($1::bigint[], $2::text[]) WITH ORDINALITY\n AS u(detail_id, verdict, ord)\n ),\n resolved AS (\n SELECT\n i.ord,\n didws.project_id,\n didws.key AS detail_key,\n i.verdict\n FROM incoming i\n INNER JOIN delphi_issue_details_with_statuses didws ON didws.id = i.detail_id\n ),\n validated AS (\n SELECT\n (SELECT COUNT(*) FROM incoming) AS incoming_count,\n (SELECT COUNT(*) FROM resolved) AS resolved_count\n ),\n latest AS (\n SELECT DISTINCT ON (project_id, detail_key)\n project_id,\n detail_key,\n verdict\n FROM resolved\n ORDER BY project_id, detail_key, ord DESC\n ),\n deleted AS (\n DELETE FROM delphi_issue_detail_verdicts didv\n USING latest\n WHERE\n didv.project_id = latest.project_id\n AND didv.detail_key = latest.detail_key\n AND latest.verdict = 'pending'\n RETURNING 1\n ),\n upserted AS (\n INSERT INTO delphi_issue_detail_verdicts (\n project_id,\n detail_key,\n verdict\n )\n SELECT\n project_id,\n detail_key,\n verdict::delphi_report_issue_status\n FROM latest\n WHERE verdict != 'pending'\n ON CONFLICT (project_id, detail_key)\n DO UPDATE SET verdict = EXCLUDED.verdict\n RETURNING 1\n )\n SELECT\n (v.incoming_count = v.resolved_count) AS \"all_found!\",\n (SELECT COUNT(*) FROM upserted) AS \"upserted_count!\"\n FROM validated v\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "all_found!", - "type_info": "Bool" - }, - { - "ordinal": 1, - "name": "upserted_count!", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8Array", - "TextArray" - ] - }, - "nullable": [ - null, - null - ] - }, - "hash": "73e3646a21e4acb1299f0b183b92beda18c30564fc90e5213e5237f505504558" -} diff --git a/apps/labrinth/.sqlx/query-87d4778e52ac3e9fd885f9c77595705f8efc09ac21e0cf9a15c4cce019aaeb05.json b/apps/labrinth/.sqlx/query-87d4778e52ac3e9fd885f9c77595705f8efc09ac21e0cf9a15c4cce019aaeb05.json deleted file mode 100644 index 5d5edc88ae..0000000000 --- a/apps/labrinth/.sqlx/query-87d4778e52ac3e9fd885f9c77595705f8efc09ac21e0cf9a15c4cce019aaeb05.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n\t\t\tSELECT project_id\n\t\t\tFROM project_disclosures\n\t\t\tWHERE type = $1 AND project_id = ANY($2)\n\t\t\t", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "project_id", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text", - "Int8Array" - ] - }, - "nullable": [ - false - ] - }, - "hash": "87d4778e52ac3e9fd885f9c77595705f8efc09ac21e0cf9a15c4cce019aaeb05" -} diff --git a/apps/labrinth/.sqlx/query-9eea063cb153da407548f957cef7da1a33a059b0a1d00b51e27b4a5399492b13.json b/apps/labrinth/.sqlx/query-9eea063cb153da407548f957cef7da1a33a059b0a1d00b51e27b4a5399492b13.json deleted file mode 100644 index e43bc36603..0000000000 --- a/apps/labrinth/.sqlx/query-9eea063cb153da407548f957cef7da1a33a059b0a1d00b51e27b4a5399492b13.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n\t\t\tDELETE FROM project_disclosures\n\t\t\tWHERE project_id = $1 AND type = $2\n\t\t\t", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text" - ] - }, - "nullable": [] - }, - "hash": "9eea063cb153da407548f957cef7da1a33a059b0a1d00b51e27b4a5399492b13" -} diff --git a/apps/labrinth/.sqlx/query-b3aaa0b2f38950057d845b3d4dc8103c009077768b33c17e22dcef4774ae5814.json b/apps/labrinth/.sqlx/query-b3aaa0b2f38950057d845b3d4dc8103c009077768b33c17e22dcef4774ae5814.json deleted file mode 100644 index e54ff20ebf..0000000000 --- a/apps/labrinth/.sqlx/query-b3aaa0b2f38950057d845b3d4dc8103c009077768b33c17e22dcef4774ae5814.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH moderation_projects AS (\n SELECT\n m.id,\n m.slug,\n m.name,\n m.summary,\n m.description,\n m.queued,\n m.published,\n m.organization_id,\n m.team_id,\n m.components\n FROM mods m\n WHERE\n m.status = $1\n AND (\n $9::boolean = false\n OR NOT EXISTS (\n SELECT 1\n FROM delphi_issue_details_with_statuses didws\n WHERE didws.project_id = m.id\n AND didws.status = 'pending'\n )\n )\n ),\n external_dependencies AS (\n SELECT\n v.mod_id,\n COUNT(*) AS external_dependencies_count\n FROM versions v\n INNER JOIN moderation_projects mp ON mp.id = v.mod_id\n INNER JOIN dependencies d ON d.dependent_id = v.id\n WHERE d.dependency_file_name IS NOT NULL\n GROUP BY v.mod_id\n ),\n version_project_types AS (\n SELECT\n v.mod_id,\n ARRAY_AGG(DISTINCT pt.name::text) FILTER (WHERE pt.name IS NOT NULL) AS project_types\n FROM versions v\n INNER JOIN moderation_projects mp ON mp.id = v.mod_id\n INNER JOIN loaders_versions lv ON v.id = lv.version_id\n INNER JOIN loaders l ON lv.loader_id = l.id\n INNER JOIN loaders_project_types lpt ON lpt.joining_loader_id = l.id\n INNER JOIN project_types pt ON pt.id = lpt.joining_project_type_id\n WHERE v.status = ANY($2)\n GROUP BY v.mod_id\n ),\n queue_projects AS (\n SELECT\n mp.id,\n mp.slug,\n mp.name,\n mp.summary,\n mp.description,\n mp.queued,\n mp.published,\n search_organization.name AS organization_name,\n search_owner.username AS owner_name,\n CASE\n WHEN jsonb_typeof(mp.components -> 'minecraft_server') = 'object'\n THEN ARRAY_APPEND(\n ARRAY_REMOVE(\n COALESCE(vpt.project_types::text[], ARRAY[]::text[]),\n 'modpack'\n ),\n 'minecraft_java_server'\n )\n ELSE COALESCE(vpt.project_types::text[], ARRAY[]::text[])\n END AS project_types,\n COALESCE(ed.external_dependencies_count, 0) AS external_dependencies_count\n FROM moderation_projects mp\n LEFT JOIN organizations search_organization\n ON search_organization.id = mp.organization_id\n AND $3::text IS NOT NULL\n LEFT JOIN LATERAL (\n SELECT\n u.username\n FROM team_members tm\n INNER JOIN users u ON u.id = tm.user_id\n WHERE tm.team_id = mp.team_id\n AND tm.is_owner\n ORDER BY tm.ordering ASC\n LIMIT 1\n ) search_owner ON $3::text IS NOT NULL\n AND mp.organization_id IS NULL\n LEFT JOIN external_dependencies ed ON ed.mod_id = mp.id\n LEFT JOIN version_project_types vpt ON vpt.mod_id = mp.id\n ),\n filtered_projects AS (\n SELECT\n id,\n queued,\n published,\n project_types,\n external_dependencies_count\n FROM queue_projects\n WHERE\n (\n $3::text IS NULL\n OR name ILIKE '%' || $3 || '%'\n OR slug ILIKE '%' || $3 || '%'\n OR summary ILIKE '%' || $3 || '%'\n OR description ILIKE '%' || $3 || '%'\n OR owner_name ILIKE '%' || $3 || '%'\n OR organization_name ILIKE '%' || $3 || '%'\n OR EXISTS (\n SELECT 1\n FROM UNNEST(project_types) AS searched_project_type(project_type)\n WHERE searched_project_type.project_type ILIKE '%' || $3 || '%'\n )\n )\n AND (\n $4::text IS NULL\n OR ($4 = 'none' AND CARDINALITY(project_types) = 0)\n OR ($4 = 'minecraft_java_server' AND project_types @> ARRAY['minecraft_java_server']::text[])\n OR ($4 <> 'none' AND $4 <> 'minecraft_java_server' AND\n project_types[1] = $4\n )\n )\n AND ($5::boolean IS NULL OR (external_dependencies_count > 0) = $5)\n ),\n total AS (\n SELECT COUNT(*) AS total_count FROM filtered_projects\n ),\n page_ids AS (\n SELECT\n id,\n queued,\n published,\n project_types,\n external_dependencies_count\n FROM filtered_projects\n ORDER BY\n CASE WHEN $8 = 'most_external_deps' THEN external_dependencies_count END DESC,\n CASE WHEN $8 = 'least_external_deps' THEN external_dependencies_count END ASC,\n CASE WHEN $8 = 'newest' THEN COALESCE(queued, published) END DESC NULLS LAST,\n CASE WHEN $8 IN ('oldest', 'most_external_deps', 'least_external_deps') THEN COALESCE(queued, published) END ASC NULLS LAST,\n id ASC\n OFFSET $7\n LIMIT $6\n ),\n page_projects AS (\n SELECT\n m.id,\n m.slug,\n m.name,\n m.summary,\n m.icon_url,\n m.status,\n m.requested_status,\n m.queued,\n m.published,\n m.updated,\n m.organization_id,\n m.team_id,\n o.name AS organization_name,\n o.icon_url AS organization_icon_url,\n owner.user_id AS owner_id,\n owner.username AS owner_name,\n owner.avatar_url AS owner_icon_url,\n page_ids.project_types,\n page_ids.external_dependencies_count\n FROM page_ids\n INNER JOIN mods m ON m.id = page_ids.id\n LEFT JOIN organizations o ON o.id = m.organization_id\n LEFT JOIN LATERAL (\n SELECT\n tm.user_id,\n u.username,\n u.avatar_url\n FROM team_members tm\n INNER JOIN users u ON u.id = tm.user_id\n WHERE tm.team_id = m.team_id\n AND tm.is_owner\n ORDER BY tm.ordering ASC\n LIMIT 1\n ) owner ON m.organization_id IS NULL\n )\n SELECT\n total.total_count AS \"total_count!\",\n page_projects.id AS \"id?\",\n page_projects.slug AS \"slug?\",\n page_projects.name AS \"name?\",\n page_projects.summary AS \"summary?\",\n page_projects.icon_url AS \"icon_url?\",\n page_projects.status AS \"status?\",\n page_projects.requested_status AS \"requested_status?\",\n page_projects.queued AS \"queued?\",\n page_projects.published AS \"published?\",\n page_projects.updated AS \"updated?\",\n page_projects.organization_id AS \"organization_id?\",\n page_projects.organization_name AS \"organization_name?\",\n page_projects.organization_icon_url AS \"organization_icon_url?\",\n page_projects.owner_id AS \"owner_id?\",\n page_projects.owner_name AS \"owner_name?\",\n page_projects.owner_icon_url AS \"owner_icon_url?\",\n page_projects.project_types AS \"project_types?: Vec\",\n page_projects.external_dependencies_count AS \"external_dependencies_count?\"\n FROM total\n LEFT JOIN page_projects ON true\n ORDER BY\n CASE WHEN $8 = 'most_external_deps' THEN page_projects.external_dependencies_count END DESC,\n CASE WHEN $8 = 'least_external_deps' THEN page_projects.external_dependencies_count END ASC,\n CASE WHEN $8 = 'newest' THEN COALESCE(page_projects.queued, page_projects.published) END DESC NULLS LAST,\n CASE WHEN $8 IN ('oldest', 'most_external_deps', 'least_external_deps') THEN COALESCE(page_projects.queued, page_projects.published) END ASC NULLS LAST,\n page_projects.id ASC\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "total_count!", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "id?", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "slug?", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "name?", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "summary?", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "icon_url?", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "status?", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "requested_status?", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "queued?", - "type_info": "Timestamptz" - }, - { - "ordinal": 9, - "name": "published?", - "type_info": "Timestamptz" - }, - { - "ordinal": 10, - "name": "updated?", - "type_info": "Timestamptz" - }, - { - "ordinal": 11, - "name": "organization_id?", - "type_info": "Int8" - }, - { - "ordinal": 12, - "name": "organization_name?", - "type_info": "Text" - }, - { - "ordinal": 13, - "name": "organization_icon_url?", - "type_info": "Varchar" - }, - { - "ordinal": 14, - "name": "owner_id?", - "type_info": "Int8" - }, - { - "ordinal": 15, - "name": "owner_name?", - "type_info": "Varchar" - }, - { - "ordinal": 16, - "name": "owner_icon_url?", - "type_info": "Varchar" - }, - { - "ordinal": 17, - "name": "project_types?: Vec", - "type_info": "TextArray" - }, - { - "ordinal": 18, - "name": "external_dependencies_count?", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text", - "TextArray", - "Text", - "Text", - "Bool", - "Int8", - "Int8", - "Text", - "Bool" - ] - }, - "nullable": [ - null, - false, - true, - false, - false, - true, - false, - true, - true, - false, - false, - true, - false, - true, - false, - false, - true, - null, - null - ] - }, - "hash": "b3aaa0b2f38950057d845b3d4dc8103c009077768b33c17e22dcef4774ae5814" -} diff --git a/apps/labrinth/.sqlx/query-d4b427672138b0c75f123a23ce104f69a6d12ff29e21a15f8fdd73386634a3ec.json b/apps/labrinth/.sqlx/query-d4b427672138b0c75f123a23ce104f69a6d12ff29e21a15f8fdd73386634a3ec.json deleted file mode 100644 index a904ea2708..0000000000 --- a/apps/labrinth/.sqlx/query-d4b427672138b0c75f123a23ce104f69a6d12ff29e21a15f8fdd73386634a3ec.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n\t\t\tINSERT INTO project_disclosures (project_id, type, metadata, updated_by, set_by_moderator, lock_status)\n\t\t\tVALUES ($1, $2, $3, $4, $5, $6)\n\t\t\tON CONFLICT (project_id, type) DO UPDATE SET\n\t\t\t\tmetadata = $3,\n\t\t\t\tupdated_at = now(),\n\t\t\t\tupdated_by = $4,\n\t\t\t\tset_by_moderator = $5,\n\t\t\t\tlock_status = $6\n\t\t\t", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Jsonb", - "Int8", - "Bool", - "Text" - ] - }, - "nullable": [] - }, - "hash": "d4b427672138b0c75f123a23ce104f69a6d12ff29e21a15f8fdd73386634a3ec" -} diff --git a/apps/labrinth/.sqlx/query-dc13b4d8b84681dc4f1ea5f4f735a5176583d2781dbb9aa428f8f920844f2a1e.json b/apps/labrinth/.sqlx/query-dc13b4d8b84681dc4f1ea5f4f735a5176583d2781dbb9aa428f8f920844f2a1e.json deleted file mode 100644 index 4004f38b3b..0000000000 --- a/apps/labrinth/.sqlx/query-dc13b4d8b84681dc4f1ea5f4f735a5176583d2781dbb9aa428f8f920844f2a1e.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n\t\t\tSELECT project_id, type AS \"disclosure_type!\", metadata, updated_at, updated_by, set_by_moderator, lock_status\n\t\t\tFROM project_disclosures\n\t\t\tWHERE project_id = $1\n\t\t\tORDER BY updated_at DESC\n\t\t\t", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "project_id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "disclosure_type!", - "type_info": "Text" - }, - { - "ordinal": 2, - "name": "metadata", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "updated_at", - "type_info": "Timestamptz" - }, - { - "ordinal": 4, - "name": "updated_by", - "type_info": "Int8" - }, - { - "ordinal": 5, - "name": "set_by_moderator", - "type_info": "Bool" - }, - { - "ordinal": 6, - "name": "lock_status", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "dc13b4d8b84681dc4f1ea5f4f735a5176583d2781dbb9aa428f8f920844f2a1e" -}