Skip to content

Commit

Permalink
Overwrite NULL values faster
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jan 23, 2025
1 parent 91de00f commit 8106627
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// except according to the terms contained in the LICENSE file.

const up = (db) => db.raw(`
UPDATE blobs SET "contentType"='application/octet-stream' WHERE "contentType" IS NULL;
ALTER TABLE blobs
ALTER COLUMN "contentType" TYPE TEXT USING(COALESCE("contentType", 'application/octet-stream')),
ALTER COLUMN "contentType" SET DEFAULT 'application/octet-stream',
ALTER COLUMN "contentType" SET NOT NULL
`);
Expand Down

0 comments on commit 8106627

Please sign in to comment.