Skip to content

Commit b4eb2d6

Browse files
committed
perf(db): add videoId column and index to notifications table
1 parent 0cb4ad4 commit b4eb2d6

File tree

4 files changed

+2824
-0
lines changed

4 files changed

+2824
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE `notifications` ADD `videoId` varchar(50);--> statement-breakpoint
2+
UPDATE `notifications` SET `videoId` = JSON_UNQUOTE(JSON_EXTRACT(`data`, '$.videoId')) WHERE `videoId` IS NULL AND JSON_EXTRACT(`data`, '$.videoId') IS NOT NULL;--> statement-breakpoint
3+
CREATE INDEX `type_recipient_video_created_idx` ON `notifications` (`type`,`recipientId`,`videoId`,`createdAt`);

0 commit comments

Comments
 (0)