Skip to content

Commit 8e2b8ae

Browse files
committed
Replace ineffective follow_own_posts migration with a working one
1 parent 38c6dc0 commit 8e2b8ae

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

db/migrate/20260208223211_follow_own_posts.rb renamed to db/migrate/20260304104100_follow_own_posts.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class FollowOwnPosts < ActiveRecord::Migration[7.2]
22
def change
3-
to_insert = Post.where.not(post_type_id: [PolicyDoc.post_type_id, HelpDoc.post_type_id])
3+
to_insert = Post.unscoped
4+
.where.not(post_type_id: [PolicyDoc.post_type_id, HelpDoc.post_type_id])
45
.where.not(user_id: nil)
56
.pluck(:id, :user_id)
67
.map { |post_id, user_id| { post_id: post_id, user_id: user_id } }

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.2].define(version: 2025_12_26_185531) do
13+
ActiveRecord::Schema[7.2].define(version: 2026_03_04_104100) do
1414
create_table "abilities", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
1515
t.bigint "community_id"
1616
t.string "name"

0 commit comments

Comments
 (0)