blob: a8f12eec1ae1702261869b9b95e8b32d0203af94 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
ALTER TABLE bookmarks ADD `type` text NOT NULL DEFAULT "text";--> statement-breakpoint
-- Fill in the bookmark type
UPDATE bookmarks
SET type = CASE
WHEN EXISTS (SELECT 1 FROM bookmarkLinks WHERE bookmarkLinks.id = bookmarks.id)
THEN 'link'
WHEN EXISTS (SELECT 1 FROM bookmarkTexts WHERE bookmarkTexts.id = bookmarks.id)
THEN 'text'
WHEN EXISTS (SELECT 1 FROM bookmarkAssets WHERE bookmarkAssets.id = bookmarks.id)
THEN 'asset'
END;
|