Skip to content

Commit

Permalink
Remove 'on delete set null' from key_hash definition
Browse files Browse the repository at this point in the history
  • Loading branch information
nanjiangshu committed Aug 23, 2024
1 parent 783bbb8 commit d7565f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion postgresql/initdb.d/01_main.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CREATE TABLE files (

header TEXT,
encryption_method TEXT,
key_hash TEXT REFERENCES encryption_keys(key_hash) ON DELETE SET NULL,
key_hash TEXT REFERENCES encryption_keys(key_hash),


-- Table Audit / Logs
Expand Down
2 changes: 1 addition & 1 deletion postgresql/migratedb.d/12.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BEGIN
);

ALTER TABLE sda.files ADD COLUMN IF NOT EXISTS key_hash TEXT,
ADD CONSTRAINT fk_files_key_hash FOREIGN KEY (key_hash) REFERENCES sda.encryption_keys(key_hash) ON DELETE SET NULL;
ADD CONSTRAINT fk_files_key_hash FOREIGN KEY (key_hash) REFERENCES sda.encryption_keys(key_hash);

ELSE
RAISE NOTICE 'Schema migration from % to % does not apply now, skipping', sourcever, sourcever+1;
Expand Down

0 comments on commit d7565f2

Please sign in to comment.