mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-11 17:04:59 +08:00
fix: disallow duplicate folders
This commit is contained in:
parent
abcf81b204
commit
d0d0f2f8ed
1 changed files with 7 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
-- +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 AND type='file'::text);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS unique_folder ON teldrive.files USING btree (name, parent_id, user_id) WHERE (type='folder'::text);
|
||||
|
||||
-- +goose StatementEnd
|
Loading…
Add table
Reference in a new issue