posts: redefine source column to be non-NULL (fixes #3090).
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
class ChangeSourceToNonNullOnPosts < ActiveRecord::Migration
|
||||
def up
|
||||
Post.without_timeout do
|
||||
change_column_null(:posts, :source, false, "")
|
||||
change_column_default(:posts, :source, "")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
Post.without_timeout do
|
||||
change_column_null(:posts, :source, true)
|
||||
change_column_default(:posts, :source, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user