From 43a21d9d86513c04e17b1b209b05eb0acdf83657 Mon Sep 17 00:00:00 2001 From: divyam234 <47589864+divyam234@users.noreply.github.com> Date: Sun, 9 Jun 2024 03:07:31 +0530 Subject: [PATCH] feat: add size to unique fingerprint --- internal/database/migrations/20240609025818_constraint.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 internal/database/migrations/20240609025818_constraint.sql diff --git a/internal/database/migrations/20240609025818_constraint.sql b/internal/database/migrations/20240609025818_constraint.sql new file mode 100644 index 0000000..ead6160 --- /dev/null +++ b/internal/database/migrations/20240609025818_constraint.sql @@ -0,0 +1,5 @@ +-- +goose Up +-- +goose StatementBegin +DROP INDEX IF EXISTS teldrive.unique_file; +CREATE UNIQUE INDEX IF NOT EXISTS unique_file ON teldrive.files USING btree (name, parent_id, user_id,size) WHERE (status = 'active'::text); +-- +goose StatementEnd