From 0f719e1dacaa9c3ebbda9dd2eda73f2bf2941736 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 21 Dec 2023 17:37:16 +0000 Subject: [PATCH] Commit working scripts --- date_audit.sql | 1 + gitea-dater.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 date_audit.sql create mode 100644 gitea-dater.sql diff --git a/date_audit.sql b/date_audit.sql new file mode 100644 index 0000000..581d4ec --- /dev/null +++ b/date_audit.sql @@ -0,0 +1 @@ +SELECT r.owner_name, r.lower_name, to_timestamp(max(b.commit_time)), to_timestamp(r.updated_unix) FROM repository AS r INNER JOIN branch b ON b.repo_id=r.id where r.is_archived=true GROUP BY r.owner_name, r.lower_name, r.updated_unix ORDER BY r.owner_name, r.lower_name; diff --git a/gitea-dater.sql b/gitea-dater.sql new file mode 100644 index 0000000..2790c05 --- /dev/null +++ b/gitea-dater.sql @@ -0,0 +1 @@ +UPDATE repository set updated_unix=sub.commit_time FROM (SELECT r.id, max(b.commit_time) as commit_time FROM repository AS r INNER JOIN branch b ON b.repo_id=r.id where r.is_archived=true GROUP BY r.id) as sub where repository.id = sub.id;