Merge pull request #8736 from gschlager/rename_reply_id_column

REFACTOR: Rename `post_replies.reply_id` column to `post_replies.reply_post_id`
This commit is contained in:
Gerhard Schlager
2020-01-17 17:24:49 +01:00
committed by GitHub
parent 3b5a6c9895
commit ab07b945c2
14 changed files with 81 additions and 30 deletions

View File

@ -45,7 +45,7 @@ def insert_post_replies
log "Inserting post replies..."
DB.exec <<-SQL
INSERT INTO post_replies (post_id, reply_id, created_at, updated_at)
INSERT INTO post_replies (post_id, reply_post_id, created_at, updated_at)
SELECT p2.id, p.id, p.created_at, p.created_at
FROM posts p
INNER JOIN posts p2 ON p2.post_number = p.reply_to_post_number AND p2.topic_id = p.topic_id
@ -300,7 +300,7 @@ def update_posts
# WITH X AS (
# SELECT pr.post_id, p.user_id
# FROM post_replies pr
# JOIN posts p ON p.id = pr.reply_id
# JOIN posts p ON p.id = pr.reply_post_id
# )
# UPDATE posts
# SET reply_to_user_id = X.user_id