From 37b639d5374136d82e154b0941b9a7e623ab5f85 Mon Sep 17 00:00:00 2001 From: lelemm Date: Mon, 11 Nov 2024 09:39:52 -0300 Subject: [PATCH] Update migrations/1719409568000-multiuser.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- migrations/1719409568000-multiuser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migrations/1719409568000-multiuser.js b/migrations/1719409568000-multiuser.js index bd7b35233..c39ffe03f 100644 --- a/migrations/1719409568000-multiuser.js +++ b/migrations/1719409568000-multiuser.js @@ -16,8 +16,9 @@ export const up = async function () { CREATE TABLE user_access (user_id TEXT, file_id TEXT, - FOREIGN KEY (user_id) REFERENCES users(id) - , FOREIGN KEY (file_id) REFERENCES files(id) + PRIMARY KEY (user_id, file_id), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (file_id) REFERENCES files(id) ); ALTER TABLE files