mirror of
https://github.com/perstarkse/minne.git
synced 2026-05-30 03:10:45 +02:00
chore: harden analytics, conversation access, and per-user file dedup
Use UPSERT for analytics counters, enforce message ownership in SQL, return NotFound when patch_title updates nothing, scope file dedup by user_id with a composite unique index, and expand tests for auth, ordering, and edge cases.
This commit is contained in:
@@ -13,7 +13,6 @@ DEFINE FIELD IF NOT EXISTS file_name ON file TYPE string;
|
||||
DEFINE FIELD IF NOT EXISTS mime_type ON file TYPE string;
|
||||
DEFINE FIELD IF NOT EXISTS user_id ON file TYPE string;
|
||||
|
||||
# Indexes based on usage (get_by_sha, potentially user lookups)
|
||||
# Using UNIQUE based on the logic in FileInfo::new to prevent duplicates
|
||||
DEFINE INDEX IF NOT EXISTS file_sha256_idx ON file FIELDS sha256 UNIQUE;
|
||||
# Indexes based on usage (get_by_sha scoped by user_id, user lookups)
|
||||
DEFINE INDEX IF NOT EXISTS file_user_sha256_idx ON file FIELDS user_id, sha256 UNIQUE;
|
||||
DEFINE INDEX IF NOT EXISTS file_user_id_idx ON file FIELDS user_id;
|
||||
|
||||
Reference in New Issue
Block a user