fix: update comment and SQL statement to set semantic_id with _id prefix
Some checks failed
Frontend CI / build (push) Successful in 1m21s
Auto Comment On PR / add_improve_comment (pull_request) Successful in 17s
PR Title Check / pr-title-check (pull_request) Failing after 16s

This commit is contained in:
SquidSpirit 2025-10-12 17:18:41 +08:00
parent 8f91d815bc
commit 9d6098c353

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);