From 6bc304dd7fec0804e53f354b17adf84e3f934e41 Mon Sep 17 00:00:00 2001 From: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Date: Wed, 4 Mar 2026 19:38:09 -0800 Subject: [PATCH] Fixed: add missing indexes for DB cleanup --- .../migrations/postgres/20260304090200_indexes.down.sql | 1 + .../migrations/postgres/20260304090200_indexes.up.sql | 6 ++++++ .../migrations/sqlite/20260304090200_indexes.down.sql | 1 + .../migrations/sqlite/20260304090200_indexes.up.sql | 6 ++++++ 4 files changed, 14 insertions(+) create mode 100644 backend/resources/migrations/postgres/20260304090200_indexes.down.sql create mode 100644 backend/resources/migrations/postgres/20260304090200_indexes.up.sql create mode 100644 backend/resources/migrations/sqlite/20260304090200_indexes.down.sql create mode 100644 backend/resources/migrations/sqlite/20260304090200_indexes.up.sql diff --git a/backend/resources/migrations/postgres/20260304090200_indexes.down.sql b/backend/resources/migrations/postgres/20260304090200_indexes.down.sql new file mode 100644 index 00000000..f8e19576 --- /dev/null +++ b/backend/resources/migrations/postgres/20260304090200_indexes.down.sql @@ -0,0 +1 @@ +-- No-op \ No newline at end of file diff --git a/backend/resources/migrations/postgres/20260304090200_indexes.up.sql b/backend/resources/migrations/postgres/20260304090200_indexes.up.sql new file mode 100644 index 00000000..b288f044 --- /dev/null +++ b/backend/resources/migrations/postgres/20260304090200_indexes.up.sql @@ -0,0 +1,6 @@ +CREATE INDEX IF NOT EXISTS idx_webauthn_sessions_expires_at ON webauthn_sessions (expires_at); +CREATE INDEX IF NOT EXISTS idx_one_time_access_tokens_expires_at ON one_time_access_tokens (expires_at); +CREATE INDEX IF NOT EXISTS idx_oidc_authorization_codes_expires_at ON oidc_authorization_codes (expires_at); +CREATE INDEX IF NOT EXISTS idx_oidc_refresh_tokens_expires_at ON oidc_refresh_tokens (expires_at); +CREATE INDEX IF NOT EXISTS idx_reauthentication_tokens_expires_at ON reauthentication_tokens (expires_at); +CREATE INDEX IF NOT EXISTS idx_email_verification_tokens_expires_at ON email_verification_tokens (expires_at); \ No newline at end of file diff --git a/backend/resources/migrations/sqlite/20260304090200_indexes.down.sql b/backend/resources/migrations/sqlite/20260304090200_indexes.down.sql new file mode 100644 index 00000000..f8e19576 --- /dev/null +++ b/backend/resources/migrations/sqlite/20260304090200_indexes.down.sql @@ -0,0 +1 @@ +-- No-op \ No newline at end of file diff --git a/backend/resources/migrations/sqlite/20260304090200_indexes.up.sql b/backend/resources/migrations/sqlite/20260304090200_indexes.up.sql new file mode 100644 index 00000000..b288f044 --- /dev/null +++ b/backend/resources/migrations/sqlite/20260304090200_indexes.up.sql @@ -0,0 +1,6 @@ +CREATE INDEX IF NOT EXISTS idx_webauthn_sessions_expires_at ON webauthn_sessions (expires_at); +CREATE INDEX IF NOT EXISTS idx_one_time_access_tokens_expires_at ON one_time_access_tokens (expires_at); +CREATE INDEX IF NOT EXISTS idx_oidc_authorization_codes_expires_at ON oidc_authorization_codes (expires_at); +CREATE INDEX IF NOT EXISTS idx_oidc_refresh_tokens_expires_at ON oidc_refresh_tokens (expires_at); +CREATE INDEX IF NOT EXISTS idx_reauthentication_tokens_expires_at ON reauthentication_tokens (expires_at); +CREATE INDEX IF NOT EXISTS idx_email_verification_tokens_expires_at ON email_verification_tokens (expires_at); \ No newline at end of file