```ruby
# Category.where(parent_id: 0).update_all(parent_id: nil) # Uncomment this line if your project already has :parent_id
```