-- Drop foreign key constraint on files.user_id -- Anonymous users may not exist in users table (conversations also has no FK on user_id) ALTER TABLE files DROP CONSTRAINT IF EXISTS files_user_id_fkey;