diff --git a/server/migrations/20261007000002_create_tokens.sql b/server/migrations/20261007000002_create_access_tokens.sql
similarity index 53%
rename from server/migrations/20261007000002_create_tokens.sql
rename to server/migrations/20261007000002_create_access_tokens.sql
index 626ccee..5395121 100644
--- a/server/migrations/20261007000002_create_tokens.sql
+++ b/server/migrations/20261007000002_create_access_tokens.sql
@@ -7,14 +7,4 @@ CREATE TABLE access_tokens (
),
expires_at TIMESTAMPTZ NOT NULL,
issued_at TIMESTAMPTZ NOT NULL
-);
-
-CREATE TABLE refresh_tokens (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
- access_token_id UUID NOT NULL UNIQUE CONSTRAINT fk_refresh_tokens_access_token REFERENCES access_tokens (id) ON DELETE CASCADE,
- secret_hash BYTEA NOT NULL UNIQUE CHECK (
- octet_length(secret_hash) = 32
- ),
- expires_at TIMESTAMPTZ NOT NULL,
- issued_at TIMESTAMPTZ NOT NULL
);
\ No newline at end of file
diff --git a/server/migrations/20261007000003_create_refresh_tokens.sql b/server/migrations/20261007000003_create_refresh_tokens.sql
new file mode 100644
index 0000000..c8f5012
--- /dev/null
+++ b/server/migrations/20261007000003_create_refresh_tokens.sql
@@ -0,0 +1,9 @@
+CREATE TABLE refresh_tokens (
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
+ access_token_id UUID NOT NULL UNIQUE CONSTRAINT fk_refresh_tokens_access_token REFERENCES access_tokens (id) ON DELETE CASCADE,
+ secret_hash BYTEA NOT NULL UNIQUE CHECK (
+ octet_length(secret_hash) = 32
+ ),
+ expires_at TIMESTAMPTZ NOT NULL,
+ issued_at TIMESTAMPTZ NOT NULL
+);
\ No newline at end of file
diff --git a/server/src/database.rs b/server/src/database.rs
index 4e66961..656a402 100644
--- a/server/src/database.rs
+++ b/server/src/database.rs
@@ -1,9 +1,10 @@
+pub mod access_tokens;
pub mod account_members;
pub mod accounts;
pub mod dtos;
mod error_codes;
pub mod recurring_transactions;
-pub mod tokens;
+pub mod refresh_tokens;
pub mod transactions;
pub mod user_app_secrets;
pub mod user_apps;
diff --git a/server/src/database/tokens.rs b/server/src/database/access_tokens.rs
similarity index 53%
rename from server/src/database/tokens.rs
rename to server/src/database/access_tokens.rs
index d8388de..8a32a92 100644
--- a/server/src/database/tokens.rs
+++ b/server/src/database/access_tokens.rs
@@ -1,8 +1,8 @@
use crate::database::dtos::Upsert;
-use super::{DatabaseError, dtos::AccessTokenRow, dtos::RefreshTokenRow};
+use super::{DatabaseError, dtos::AccessTokenRow};
-pub async fn get_access_token_by_hash<'e, E>(
+pub async fn get_by_hash<'e, E>(
executor: E,
secret_hash: &[u8],
) -> Result