mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Change the way nuked users' posts are handled. Allow null in the user_id column of posts. Show these posts in the posts stream.
This commit is contained in:
12
db/migrate/20130903154323_allow_null_user_id_on_posts.rb
Normal file
12
db/migrate/20130903154323_allow_null_user_id_on_posts.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class AllowNullUserIdOnPosts < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :posts, :user_id, :integer, null: true
|
||||
execute "UPDATE posts SET user_id = NULL WHERE nuked_user = true"
|
||||
remove_column :posts, :nuked_user
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :posts, :nuked_user, :boolean, default: false
|
||||
change_column :posts, :user_id, :integer, null: false
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user