BLOG-125 Get post by sementic ID #134

Merged
squid merged 10 commits from BLOG-125_semantic_post_id into main 2025-10-12 18:28:58 +08:00
Showing only changes of commit 9d6098c353 - Show all commits

View File

@ -1,7 +1,7 @@
ALTER TABLE post ADD COLUMN "semantic_id" VARCHAR(100) NOT NULL DEFAULT '';
-- Update existing records to use their id as semantic_id
UPDATE post SET semantic_id = id::VARCHAR WHERE semantic_id = '';
-- Update existing records to use their id as semantic_id with _id prefix
UPDATE post SET semantic_id = '_' || id::VARCHAR WHERE semantic_id = '';
-- Create unique index on semantic_id
CREATE UNIQUE INDEX idx_post_semantic_id ON post (semantic_id);