From 9d6098c353b62e0096d1dad1d2968e8606389357 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Sun, 12 Oct 2025 17:18:41 +0800 Subject: [PATCH] fix: update comment and SQL statement to set semantic_id with _id prefix --- backend/migrations/20251011200359_add_semantic_id_to_post.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/migrations/20251011200359_add_semantic_id_to_post.sql b/backend/migrations/20251011200359_add_semantic_id_to_post.sql index 63d0294..8f60e75 100644 --- a/backend/migrations/20251011200359_add_semantic_id_to_post.sql +++ b/backend/migrations/20251011200359_add_semantic_id_to_post.sql @@ -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);